Information initialization method and device, electronic equipment, storage medium and program product

Through the information initialization method of feature point detection and dynamic sliding window strategy, combined with the beam adjustment method, it solves the problem of poor performance of the existing VIO initialization algorithm on mobile terminals and large depth-of-field scenes, improves the initialization success rate and accuracy, and is applicable For mobile terminals and large depth of field scenes.

CN118784818APending Publication Date: 2024-10-15TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310386687.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-04-03
Publication Date
2024-10-15

AI Technical Summary

Technical Problem

The existing VIO initialization algorithm has unsatisfactory results in mobile applications. It has a high initialization failure rate, cannot be applied to large depth-of-field scenes, has high computing power and power consumption, and has low initialization accuracy in indoor and outdoor open scenes. The recovered camera pose and posture The number of map points is not high.

Method used

An information initialization method based on a preset feature point detection algorithm and a dynamic sliding window strategy is used to determine the target feature points through feature point screening and beam adjustment methods, improve the number and quality of feature points, and optimize the dynamic initialization effect.

Benefits of technology

It improves the initialization success rate and accuracy, is suitable for mobile terminals and large depth-of-field scenes, reduces computing power and power consumption, and enhances the recovery ability of camera poses and map points.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118784818A_ABST
    Figure CN118784818A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides an information initialization method and device, electronic equipment, a storage medium and a program product, relates to the technical field of computer vision, and can be applied to augmented reality scenes. The method comprises the following steps: acquiring first feature points of a current frame based on a feature point detection algorithm, and if the duration and the number of the feature points in a current sliding window are determined to meet preset initialization requirements through a dynamic sliding window algorithm based on the first feature points, executing initialization operation; screening the first feature points to obtain second feature points; a third feature point with the depth value meeting the requirement is screened out from the second feature points, and first initialization information of the third feature point is determined; and determining a target feature point based on the third feature point, and determining second initialization information of the target feature point based on the first initialization information through a beam adjustment method. According to the invention, the success rate and quality of system initialization can be effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer vision technology. Specifically, the present application relates to an information initialization method, device, electronic device, storage medium and program product. Background Art

[0002] Video AR (Augmented Reality) functions are widely used in various short videos, games, interactions and other fields. AR virtual object placement is adopted by many applications as a new way of interaction. Among them, the core of AR capability is real-time camera positioning, and its core algorithm is VIO (Visual Inertial Odometry). Among them, the initialization part is the core module of the algorithm and the core model for the successful startup and stable operation of the algorithm. A fast, robust, effective and high-performance VIO initialization algorithm is very important. Summary of the invention

[0003] In order to solve at least one of the above technical problems, the embodiments of the present application provide an information initialization method, device, electronic device, storage medium and program product. The technical solution is as follows:

[0004] In a first aspect, an embodiment of the present application provides an information initialization method, comprising:

[0005] Based on a preset feature point detection algorithm, a plurality of first feature points of the current frame are obtained. If, based on the first feature points, a preset dynamic sliding window algorithm is used to determine that the duration and the number of feature points in the current sliding window meet the preset initialization requirements, the following initialization operation is performed:

[0006] Based on the average pixel displacement of each of the first feature points within the sliding window, the first feature points are screened to obtain a plurality of second feature points;

[0007] Filtering out a third feature point whose depth value meets a preset requirement from the second feature points, and determining first initialization information of the third feature point;

[0008] The target feature point is determined based on the third feature point, and the second initialization information of the target feature point in the current frame is determined based on the first initialization information by using a bundle adjustment method.

[0009] In a feasible embodiment, the step of acquiring a plurality of first feature points of the current frame based on a preset feature point detection algorithm includes:

[0010] Perform the following feature extraction operations on the current frame: extract features from the current frame based on a preset feature point detection algorithm to obtain a plurality of full-image feature points and a first response value of each full-image feature point; divide the current frame into grids based on a preset grid division strategy, and retain a full-image feature point with the highest first response value for each grid; obtain a plurality of first feature points from the retained full-image feature points, and perform feature tracking on the first feature points;

[0011] Or, if there is a previous frame of the current frame, and the number of feature points of the previous frame is greater than a preset first threshold, feature tracking is performed on the feature points of the previous frame, otherwise the feature extraction operation is performed.

[0012] In a feasible embodiment, retaining a whole-image feature point with the highest first response value for each grid includes performing the following operations for each grid:

[0013] Obtaining the center position of the full-image feature point with the highest response value in the current grid of the previous frame, obtaining a second response value based on the distance between each full-image feature point in the current grid of the current frame and the center position, and retaining the full-image feature point with the highest second response value;

[0014] If the current frame is the first frame, the full-image feature point with the highest first response value is retained.

[0015] In a feasible embodiment, the step of obtaining a plurality of first feature points from the retained full-image feature points includes:

[0016] If the number of the full-image feature points is greater than a preset second threshold, the following line feature deletion operation is performed for each full-image feature point:

[0017] Calculate the pixel difference of the feature points of the whole image in the horizontal and vertical directions of the image;

[0018] In a target area determined based on a preset pixel range, determining a gradient direction of each pixel point based on the pixel difference;

[0019] Determining a histogram including a plurality of check blocks based on the gradient direction, wherein the check blocks are determined based on preset check parameters;

[0020] If the gradient direction of the center point of the target area and the gradient direction with the highest number in the histogram indicate the same check block, and the highest number in the histogram is greater than the second highest number in the histogram by a preset third threshold, the feature point of the entire image is determined as a line feature and deleted.

[0021] In a feasible embodiment, based on the first feature point, determining by a preset dynamic sliding window algorithm whether the duration and the number of feature points in the current sliding window meet a preset initialization requirement includes:

[0022] If the duration in the current sliding window is longer than the sliding window duration determined based on the average moving distance of the feature point pixels, determining whether the motion excitation indicated by the IMU data between the current frame and the previous frame is greater than a preset fourth threshold;

[0023] If yes, when the number of feature points in the current sliding window meets the preset number requirement, determining whether the duration and the number of feature points in the current sliding window meet the preset initialization requirement;

[0024] The determination of the sliding window duration includes:

[0025] Determining whether an average moving distance of feature point pixels of the first feature point in the current sliding window is greater than a preset fourth threshold based on a preset sliding window duration;

[0026] If yes, shorten the sliding window duration based on a preset duration range;

[0027] If not, the sliding window duration is increased based on the duration range.

[0028] In a feasible embodiment, determining the sliding window duration further includes:

[0029] Get the depth of field parameters corresponding to the last initialization failure;

[0030] If the depth of field parameter indicates that the depth of field of the current scene is greater than a preset fifth threshold, increasing the sliding window duration within the duration range;

[0031] If the depth of field parameter indicates that the depth of field of the current scene is less than or equal to the fifth threshold, the sliding window duration is shortened within the duration range.

[0032] In a feasible embodiment, the first feature points are screened based on the average pixel displacement of each first feature point in the sliding window to obtain a plurality of second feature points, including:

[0033] Calculating the average pixel displacement of each of the first feature points within the sliding window based on the positions of the feature points obtained by feature tracking of each of the first feature points in the continuous frames of the video;

[0034] Acquire a plurality of second feature points with larger displacement from the first feature points based on the average pixel displacement;

[0035] The number of the second feature points is related to the average pixel displacement of the entire image determined by the average pixel displacement of all the first feature points; the larger the average pixel displacement of the entire image is, the larger the number of the second feature points is.

[0036] In a feasible embodiment, the first initialization information includes at least one of camera pose information and three-dimensional coordinate information;

[0037] The step of selecting a third feature point whose depth value meets a preset requirement from the second feature point and determining first initialization information of the third feature point includes:

[0038] Acquire an initialization frame including the current frame based on a preset interval within the sliding window;

[0039] The following elimination operation is performed on each of the second feature points to obtain a third feature point whose depth value meets the preset requirements:

[0040] Calculate the camera pose information and three-dimensional space coordinate information of the second feature point in the initialization frame, where the camera pose information includes at least one of displacement information, rotation information, and speed information;

[0041] Determine the farthest movement distance of the second feature point in the initialization frame based on the displacement information;

[0042] If the depth value determined based on the farthest movement distance and the preset weight is less than the depth value indicated by the three-dimensional space coordinate information, the second feature point is removed.

[0043] In a feasible embodiment, determining the target feature point based on the third feature point includes:

[0044] If the number of the third feature points is less than a preset sixth threshold, feature points are supplemented based on the first feature points until the number of target feature points obtained reaches a preset seventh threshold;

[0045] If the number of the third feature points is greater than or equal to the sixth threshold, the third feature points are determined as target feature points.

[0046] In a feasible embodiment, the supplementing feature points based on the first feature points includes:

[0047] Acquire multiple valid feature points other than the first feature points from the feature points of the entire image;

[0048] If the valid feature point is followed by at least a preset eighth threshold number of frames in the initialization frame, the three-dimensional coordinate information of the valid feature point is restored by a feature point triangulation algorithm;

[0049] Acquire a fourth feature point whose depth value meets the preset requirements from the restored valid feature points;

[0050] determining the third feature point and the fourth feature point as target feature points;

[0051] The initialization frame is a preset number of image frames including the current frame acquired within the sliding window based on a preset interval.

[0052] In a feasible embodiment, the second initialization information includes at least one of camera pose information and three-dimensional coordinate information;

[0053] The step of determining the second initialization information of the target feature point in the current frame based on the first initialization information by using the bundle adjustment method includes:

[0054] Using the depth value in the three-dimensional coordinate information as a constraint parameter of a bundle adjustment method, and determining second initialization information of the target feature point based on the first initialization information through the bundle adjustment method;

[0055] The target feature points are eliminated based on the preset elimination conditions. If the number of remaining target feature points after elimination is less than the preset ninth threshold, the initialization fails. Otherwise, when it is determined that the bias value indicated by the camera posture information is less than or equal to the preset tenth threshold, the initialization is determined to be successful.

[0056] In a second aspect, the present application provides an information initialization device, comprising:

[0057] An initialization module is used to obtain multiple first feature points of the current frame based on a preset feature point detection algorithm. If, based on the first feature points, the duration and the number of feature points in the current sliding window are determined by a preset dynamic sliding window algorithm to meet the preset initialization requirements, the following initialization operation is performed:

[0058] Based on the average pixel displacement of each of the first feature points within the sliding window, the first feature points are screened to obtain a plurality of second feature points;

[0059] Filtering out a third feature point whose depth value meets a preset requirement from the second feature points, and determining first initialization information of the third feature point;

[0060] The target feature point is determined based on the third feature point, and the second initialization information of the target feature point in the current frame is determined based on the first initialization information by using a bundle adjustment method.

[0061] In a third aspect, an embodiment of the present application provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory, and the processor executes the computer program to implement the steps of the information initialization method provided in the first aspect above.

[0062] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the information initialization method provided in the first aspect are implemented.

[0063] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of the information initialization method provided in the first aspect above.

[0064] The beneficial effects of the technical solution provided by the embodiment of the present application are:

[0065] The embodiment of the present application provides a method for information initialization. Specifically, first, based on a preset feature point detection algorithm, multiple first feature points of the current frame are obtained, and based on the first feature points, a preset dynamic sliding window algorithm is used to determine whether the duration and the number of feature points in the current sliding window meet the preset initialization requirements. The present application first processes the data association in the initialization window more effectively through robust feature point detection and sliding window strategy; then, when it is determined that the initialization requirements are met, an initialization operation is performed, specifically, first based on the average pixel displacement of each first feature point in the sliding window, the first feature points are screened to obtain multiple second feature points, and a third feature point whose depth value meets the preset requirements is screened from the second feature points, and the first initialization information of the third feature point is determined, and then the target feature point is determined based on the third feature point, and the second initialization information of the target feature point is determined based on the first initialization information through the bundle adjustment method; that is, the present application utilizes a multi-stage system state solution method, and the implementation of this scheme can effectively improve the number and quality of the adopted feature points, optimize the dynamic initialization effect, and improve the initialization success rate and accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0066] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in describing the embodiments of the present application are briefly introduced below.

[0067] Figure 1 A flowchart of an information initialization method provided in an embodiment of the present application;

[0068] Figure 2 A flowchart of an initialization algorithm provided in an embodiment of the present application;

[0069] Figure 3A schematic diagram of a grid division strategy provided in an embodiment of the present application;

[0070] Figure 4 A schematic diagram of a line feature provided in an embodiment of the present application;

[0071] Figure 5 An application schematic diagram of an AR scenario provided in an embodiment of the present application;

[0072] Figure 6 A schematic diagram of another AR scenario application provided in an embodiment of the present application;

[0073] Figure 7 A schematic diagram of the structure of an information initialization device provided in an embodiment of the present application;

[0074] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0075] The embodiments of the present application are described below in conjunction with the drawings in the present application. It should be understood that the implementation methods described below in conjunction with the drawings are exemplary descriptions for explaining the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions of the embodiments of the present application.

[0076] It will be understood by those skilled in the art that, unless specifically stated, the singular forms "one", "said", and "the" used herein may also include plural forms. It should be further understood that the terms "including" and "comprising" used in the embodiments of the present application refer to that the corresponding features can be implemented as the presented features, information, data, steps, operations, elements and / or components, but do not exclude the implementation as other features, information, data, steps, operations, elements, components and / or combinations thereof supported by the technical field. It should be understood that when we say that an element is "connected" or "coupled" to another element, the one element may be directly connected or coupled to the other element, or it may refer to that the one element and the other element establish a connection relationship through an intermediate element. In addition, the "connection" or "coupling" used herein may include wireless connection or wireless coupling. The term "and / or" used herein indicates at least one of the items defined by the term, for example, "A and / or B" may be implemented as "A", or as "B", or as "A and B".

[0077] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.

[0078] The embodiments of the present application involve artificial intelligence (AI), which is a 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, which attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines so that the machines have the functions of perception, reasoning and decision-making. Artificial intelligence technology is a comprehensive discipline that involves a wide range of fields, including both hardware-level technology and software-level technology. Basic artificial intelligence technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. Artificial intelligence software technology mainly includes several major directions such as computer vision technology, speech processing technology, natural language processing technology, and machine learning / deep learning.

[0079] Specifically, the embodiments of the present application relate to computer vision technology (Computer Vision, CV). Computer vision is a science that studies how to make machines "see". To put it more concretely, it refers to machine vision such as using cameras and computers to replace human eyes to identify, follow and measure targets, and further perform graphic processing so that computer processing becomes an image that is more suitable for human eye observation or transmission to instrument 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 multidimensional data. Computer vision technology generally includes image processing, image recognition, image semantic understanding, image retrieval, OCR, video processing, video semantic understanding, video content / behavior recognition, three-dimensional object reconstruction, 3D 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.

[0080] In the embodiments of the present application, augmented reality technology may be involved. In an AR scenario, the core of realizing AR capability is to perform real-time camera positioning, and its core algorithm is VIO.

[0081] Among the related technologies, the VIO initialization positioning solution and the open source solution are not friendly to multiple scenes and mobile terminals. Considering the computing power and robustness, most of the results are not ideal, the initialization failure rate is high, and it cannot be directly applied on the mobile terminal. Among them, the scene initialization methods include open source solutions such as ORB-SLAM3, VINS-MONO, and Open-VINS. ORB-SLAM3 and VINS-MONO both use the vision-IMU loose coupling initialization solution, and Open-vins uses a tightly coupled initialization solution. These solutions perform generally in actual tests for scenes with large depth of field and limited computing power. Most of the existing open source solutions have high computing power requirements, enable multi-threaded acceleration, and have high power consumption requirements. At the same time, it is difficult to handle scenes with large depth of field. The initialization failure rate is high in open indoor and outdoor scenes, the initialization accuracy is low, and the number of restored camera poses and map points is not high.

[0082] In response to at least one technical problem existing in the above-mentioned prior art, an embodiment of the present application provides a scene-robust fast VISLAM (Visual Inertial Odometer Simultaneous Localization and Mapping) dynamic initialization method, which can utilize the original camera and IMU (inertial motion unit) sensor input to complete the VISLAM system initialization, calculate the camera's pose and related point cloud to meet subsequent positioning requirements.

[0083] The information initialization method proposed in the embodiment of the present application can be applied to AR scenarios to process the business needs of operating objects to click and place virtual models in the scene.

[0084] The following describes several exemplary embodiments to illustrate the technical solutions of the embodiments of the present application and the technical effects produced by the technical solutions of the present application. It should be noted that the following embodiments can refer to, draw on or combine with each other, and the same terms, similar features and similar implementation steps in different embodiments will not be described repeatedly.

[0085] The following describes the information initialization method in the embodiment of the present application.

[0086] Specifically, the method provided in the embodiment of the present application can be run on a terminal (also referred to as a device), and the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, an intelligent voice interaction device (such as a smart speaker), a wearable electronic device (such as a smart watch), a vehicle terminal, a smart home appliance (such as a smart TV), an AR / VR device, etc., but is not limited to this.

[0087] like Figure 1As shown, the information initialization method includes step S101:

[0088] Step S101: Based on a preset feature point detection algorithm, a plurality of first feature points of the current frame are obtained. If, based on the first feature points, the duration and the number of feature points in the current sliding window are determined by a preset dynamic sliding window algorithm to meet the preset initialization requirements, the following initialization operations of steps S201 to S203 are performed:

[0089] Step S201: based on the average pixel displacement of each of the first feature points in the sliding window, the first feature points are screened to obtain a plurality of second feature points.

[0090] Step S202: selecting a third feature point whose depth value meets a preset requirement from the second feature points, and determining first initialization information of the third feature point.

[0091] Step S203: determining a target feature point based on the third feature point, and determining second initialization information of the target feature point in the current frame based on the first initialization information by using a bundle adjustment method.

[0092] Specifically, Figure 2 As shown, the embodiment of the present application divides the entire implementation process into two parts, one part is the feature association part, which considers whether the current system state can enter the initialization part by executing the above step S101; the other part is the state solution part, which performs multi-stage dynamic initialization state solution by executing steps S201 to S203. Optionally, as Figure 2 As shown, initialization failure may occur at any stage in the multi-stage solution process, and the system can return to the feature association part to reprocess the state data used for initialization.

[0093] The following is a detailed description of the feature-related parts of the embodiments of the present application.

[0094] In a feasible implementation, the step S101 of acquiring a plurality of first feature points of the current frame based on a preset feature point detection algorithm includes the following step A1 or step A2:

[0095] Step A1: Perform the following feature extraction operations on the current frame: extract features from the current frame based on a preset feature point detection algorithm to obtain multiple full-image feature points and a first response value of each full-image feature point; divide the current frame into grids based on a preset grid division strategy, and retain a full-image feature point with the highest first response value for each grid; obtain multiple first feature points from the retained full-image feature points, and perform feature tracking on the first feature points.

[0096] The current frame may refer to the first frame entered when the AR function is started, or may refer to the image frame corresponding to the current moment after the last initialization failure, or an image frame at other moments.

[0097] The preset feature point detection algorithm can adopt the instruction set accelerated FAST (Features From Accelerated Segment Test) algorithm, through which the FAST score value of the feature point, that is, the response value s, can be calculated during feature extraction. i .

[0098] Optionally, when the feature of the current frame is extracted by a feature point detection algorithm, multiple full-image feature points and the first response value of each full-image feature point can be obtained; on this basis, in order to ensure that the full-image feature points are evenly distributed, a grid division strategy can be used to divide the full image of the current frame into grids according to a threshold (preset value), and only one feature point with the highest first response value is retained for each grid. On this basis, multiple first feature points can be obtained from the retained full-image feature points; wherein the number of retained full-image feature points can be the same as the number of grids obtained by division. The number of first feature points obtained can be less than or equal to the number of full-image feature points. After obtaining multiple first feature points, the first feature points can be feature tracked to obtain the position information of the same feature point in continuous frames of the video.

[0099] Step A2: If there is a previous frame of the current frame, and the number of feature points of the previous frame is greater than a preset first threshold, feature tracking is performed on the feature points of the previous frame, otherwise the feature extraction operation is performed.

[0100] In the embodiment of the present application, in order to reduce the amount of calculation and the consumed resources, if there is a previous frame of the current frame, and the number of feature points (feature points used for initialization) of the previous frame is greater than the threshold T detect , then step A1 is no longer executed to extract feature points, and the feature points of the previous frame are directly followed; of course, if the number of feature points of the previous frame (the feature points used for initialization) is less than or equal to the threshold T detect , then step A1 still needs to be executed to extract feature points.

[0101] In the embodiment of the present application, after the feature point extraction is completed, a feature following step (such as Figure 2 The robust feature point extraction and following shown in the figure) can use the optical flow following method, descriptor matching method, etc. in the related technology (the present application does not specifically limit the feature following method used) to perform feature point following to extract and record the position of the same feature point in consecutive frames of the video as the output of the corresponding module.

[0102] In a feasible embodiment, in step A1, retaining a whole-image feature point with the highest first response value for each grid includes performing the following operations of step A11 to step A12 for each grid:

[0103] Step A11: Obtain the center position of the full-image feature point with the highest response value in each grid in the previous frame, obtain a second response value based on the distance between each full-image feature point in the current grid of the current frame and the center position, and retain the full-image feature point with the highest second response value.

[0104] Optionally, in order to further improve the success rate and accuracy of initialization and reduce the drift rate after initialization, the center position of the previous frame (such as Figure 3 The response value of each feature point in the whole image is updated. When processing the first frame, it is necessary to calculate the center of the feature point retained after the current grid screening. In subsequent frames, it is necessary to consider the distance between the current feature point position and the center of the previous frame, and increase the distance weight d according to the distance radius. i , the first response value s i Add the distance weight d i Then get the new response value s i ′ (second response value), and then sorting and grid screening are performed so that each grid only retains the largest response value and only retains a maximum of k feature points (related to the number of divided grids).

[0105] like Figure 3 As shown in the figure, multiple feature points appear in the same grid. While retaining the feature point with the highest response value, the distance from the average center point of the feature point in the previous frame is considered as the weight and weighted with the response value to sort and select the feature points based on the updated response value.

[0106] Step A12: If the current frame is the first frame, retain the full-image feature point with the highest first response value.

[0107] Optionally, if the current frame is the first frame, the whole-image feature point retention operation can be performed directly based on the calculated first response value during processing, that is, only one whole-image feature point with the highest first response value is retained in the current grid.

[0108] In a feasible embodiment, obtaining a plurality of first feature points from the retained full-image feature points in step A1 includes step A13:

[0109] If the number of the whole-image feature points is greater than a preset second threshold, the line feature deletion operation of the following steps A131 to A134 is performed for each whole-image feature point.

[0110] When the number of feature points in the entire image exceeds the set threshold, it indicates that the current features are sufficient. Considering that the feature texture of line features is simple and not conducive to subsequent detection and following, similar line features can be deleted. In the online feature deletion operation, the image gradient elimination method is used, specifically, the following steps A131 to A134 are performed for each feature point.

[0111] Step A131: Calculate the pixel difference of the feature points of the entire image in the horizontal and vertical directions of the image.

[0112] The gradient direction of the feature point can be calculated by the following formula (1):

[0113]

[0114] In formula (1), x diff and diff Respectively represent the pixel difference in the x direction and y direction of the image.

[0115] Step A132: In the target area determined based on the preset pixel range, determine the gradient direction of each pixel point based on the pixel difference.

[0116] The preset pixel range can be determined by parameter P1, for example, a 10-pixel range. For the corresponding feature point, within the pixel range (target area, such as Figure 4 The gradient direction of each pixel point is calculated one by one in the dotted box shown in FIG.

[0117] Step A133: determining a histogram including a plurality of check blocks based on the gradient direction, wherein the check blocks are determined based on preset check parameters.

[0118] Among them, after obtaining the gradient direction of each pixel point, the verification area can be first determined based on the preset verification parameter H1. For example, if the parameter is 5 and only 180 degrees is considered, there is a verification block for every 36 degrees (180 degrees / 5) (a total of 5 blocks are involved), and the number of gradient directions falling in every 36 degrees is counted.

[0119] Step A134: If the gradient direction of the center point of the target area and the gradient direction with the highest number in the histogram indicate the same check block, and the highest number in the histogram is greater than the second highest number in the histogram and exceeds a preset third threshold, then the feature point of the entire image is determined as a line feature and deleted.

[0120] Among them, the center point of the target area is also the position of the current feature point. If the gradient direction of the center point and the gradient direction with the highest number in the histogram indicate the same check block (it can be understood that each check block has its own corresponding gradient direction), and the highest number in the histogram is greater than the second highest number in the histogram, and the block exceeds the threshold parameter, it can be judged as a line feature and the line feature is deleted; otherwise, it indicates that the current feature point passes the line feature check and can be retained.

[0121] In a feasible embodiment, in step S101, based on the first feature point, a preset dynamic sliding window algorithm is used to determine whether the duration and the number of feature points in the current sliding window meet the preset initialization requirements, including the following steps B1-B2:

[0122] Step B1: If the duration in the current sliding window is equal to the sliding window duration determined based on the average moving distance of the feature point pixels, determine whether the motion excitation indicated by the IMU data between the current frame and the previous frame is greater than a preset fourth threshold.

[0123] Optionally, the execution flow of step B1 corresponds to Figure 2 The dynamic sliding window management module shown in FIG. 1 takes into account that the dynamic initialization module requires sufficient continuous multi-frame information to perform subsequent initialization. In order to ensure the initial success rate, a dynamic sliding window (also known as sliding window) selection can be performed. After determining the sliding window duration, if the duration in the sliding window is equal to the determined sliding window duration, the motion excitation of the IMU data (gyroscope and accelerometer data) between the current frame and the previous frame can be obtained for judgment. The motion variance of the acceleration data in the IMU is greater than the threshold value T Acc1 The sliding direction of the sliding window may be the direction of the previous frame of the current frame, that is, relative to the current frame, the object of the sliding window is the historical frame.

[0124] The determination of the sliding window duration includes steps B11 to B13:

[0125] Step B11: determining whether the average moving distance of the feature point pixels of the first feature point in the current sliding window is greater than a preset fourth threshold based on the preset sliding window duration.

[0126] Step B12: If yes, shorten the sliding window duration based on a preset duration range.

[0127] Step B13: If not, increasing the sliding window duration based on the duration range.

[0128] Optionally, the preset sliding window duration (initial sliding window time parameter) is t1 (e.g. 1s, the number of image frames in the window is usually 30 frames), and the average moving distance of the feature point pixels in the window (calculated by the previous module "Robust Feature Point Extraction and Following") is determined to be greater than the threshold value Td1 When , it means that the window moves fast, and the initial sliding window parameter t1 can be reduced, otherwise the time length can be increased. Among them, the preset time length range can be set based on experience with the shortest and longest time being t small <t1<t big .

[0129] Optionally, the determination of the sliding window duration further includes steps B14 to B16:

[0130] Step B14: Obtain the depth of field parameter corresponding to the last initialization failure.

[0131] Step B15: If the depth of field parameter indicates that the depth of field of the current scene is greater than a preset fifth threshold, the sliding window duration is increased within the duration range.

[0132] Step B16: If the depth of field parameter indicates that the depth of field of the current scene is less than or equal to the fifth threshold, shortening the sliding window duration within the duration range.

[0133] Optionally, based on step B1, the depth of field parameter when the last initialization failed is also considered (if any, by Figure 2 The scene average depth update module output shown) represents the current scene depth of field. When the depth of field is large, the sliding window time can be increased to ensure that the camera displacement in the window is sufficient for initialization. When the depth of field is small, the sliding window time can be reduced to reduce the amount of calculation and improve the efficiency of initialization while ensuring that the camera displacement in the window is sufficient.

[0134] Step B2: If yes, when the number of feature points in the current sliding window meets the preset number requirement, it is determined that the duration and the number of feature points in the current sliding window meet the preset initialization requirement.

[0135] Optionally, when it is determined that the motion excitation indicated by the IMU data between the current frame and the previous frame is greater than a preset fourth threshold, the number of feature points in the sliding window can be calculated. If the number of feature points meets the requirements, it indicates that the current state can enter the subsequent initialization state solution part.

[0136] The state solving part in the embodiment of the present application is described in detail below.

[0137] In a feasible embodiment, in step S201, the first feature points are screened based on the average pixel displacement of each of the first feature points in the sliding window to obtain a plurality of second feature points, including steps C1 and C2:

[0138] Step C1: based on the positions of the feature points obtained by feature tracking the first feature points in the continuous frames of the video, the average pixel displacement of the first feature points in the sliding window is calculated.

[0139] Step C2: acquiring a plurality of second feature points with larger displacement from the first feature points based on the average pixel displacement.

[0140] The number of the second feature points is related to the average pixel displacement of the entire image determined by the average pixel displacement of all the first feature points; the larger the average pixel displacement of the entire image is, the larger the number of the second feature points is.

[0141] In the embodiment of the present application, considering Figure 2 The feature association part shown has spatially eliminated the feature points. However, in continuous frames, some feature points are affected by occlusion, long distance and other problems, which affect the initialization effect. Therefore, by executing the above steps C1 to C2, it is possible to screen the feature points in time series, reduce the number of feature points, improve the quality of feature points, and reduce the initialization computing power.

[0142] Specifically, in the feature point following module, the position of each feature point in the continuous frames of the video can be known. Based on this, the average pixel displacement dis_f of a single feature point in the sliding window can be calculated first. i , and sort the feature points based on the average displacement of the pixels, retaining the feature points with larger displacements. The retention number threshold can be T feat .

[0143] Optionally, for the retention threshold, the average displacement dis of all features needs to be calculated avg , then according to the dis avg Adjust the retention threshold T feat For the case where the average displacement is large, it means that the image in the sliding window moves violently, and the threshold T needs to be appropriately increased. feat , retain more feature points for subsequent calculations and improve the initialization success rate.

[0144] In a feasible embodiment, the first initialization information includes at least one of camera pose information and three-dimensional coordinate information.

[0145] The camera pose information may include the rotation R and displacement t of the camera relative to the world coordinate system, 6 degrees of freedom (6-Dof), 3 rotations, 3 displacements, etc. The 3D coordinate information may include depth information.

[0146] Step S202 selects a third feature point whose depth value meets the preset requirement from the second feature points, and determines the first initialization information of the third feature point, including step D1-step D2:

[0147] Step D1: acquiring an initialization frame including the current frame within the sliding window based on a preset interval.

[0148] Among them, N frames (including the latest frame, that is, the current frame) are selected on average for the window with a sliding window length of t1 for initializing the pose calculation. For example, if there are 30 frames in a sliding window length of 1s and the preset interval is 5 frames, 6 initialization frames can be obtained at intervals.

[0149] Step D2: performing the elimination operation of the following steps D21 to D23 for each of the second feature points to obtain a third feature point whose depth value meets the preset requirements.

[0150] Step D21: Calculate the camera pose information and three-dimensional space coordinate information of the second feature point in the initialization frame, where the camera pose information includes at least one of displacement information, rotation information and speed information.

[0151] The closed-form solution method can be used to calculate the first initialization information, that is, the state value. Specifically, it includes the N camera states (P i ,Q i ,V i )i∈N;P i is the displacement of camera frame i, Q i For rotation, V i is the speed, and the 3D space coordinates of the feature points to be followed, P fj ,j∈0~M1, M1 is the remaining valid feature point (the second feature point) in the sliding window at this time.

[0152] Step D22: determining the farthest movement distance of the second feature point in the initialization frame based on the displacement information.

[0153] The maximum movement distance can be calculated by the following formula (2):

[0154] dis baseline =max(P i ,P j ),i,j∈N

[0155] ...Formula (2)

[0156] Step D23: If the depth value determined based on the farthest movement distance and the preset weight is less than the depth value indicated by the three-dimensional space coordinate information, the second feature point is removed.

[0157] Optionally, considering the poor accuracy of the depth calculation and restoration of the far point, which is not conducive to subsequent optimization, for the depth value restored by the feature point calculation, if P fj >λ1*dis baseline , then remove the feature point, where λ1 is the threshold weight parameter. At this time, the number of remaining valid feature points (third feature points) is M2.

[0158] In a feasible embodiment, after the algorithm initially solves the pose states of N frames and several 3D map points, due to the existence of noise, mismatching, occlusion and other problems, the accuracy of some 3D point recovery is not high and the number is small. Therefore, it is considered to perform feature point triangulation to restore more 2D feature points into 3D feature points, corresponding to Figure 2 The feature point supplement module shown.

[0159] Optionally, determining the target feature point based on the third feature point in step S203 includes steps E1 and E2:

[0160] Step E1: If the number of the third feature points is less than a preset sixth threshold, feature points are supplemented based on the first feature points until the number of target feature points obtained reaches a preset seventh threshold.

[0161] Optionally, when the number of the third feature points M2 <T f3 , the feature points will be supplemented on the basis of the third feature point, where T f3 is the minimum feature point number threshold.

[0162] The sixth threshold and the seventh threshold may be the same or different, and may be adjusted according to actual business needs.

[0163] Step E2: If the number of the third feature points is greater than or equal to the sixth threshold, the third feature points are determined as target feature points.

[0164] When it is determined that the current number of valid feature points is greater than or greater than the sixth threshold, it can be determined that the current number of 3D feature points is sufficient, and no feature point supplementation operation is required. The third feature point can be directly determined as the target feature point to perform subsequent operations.

[0165] In a feasible embodiment, the step E1 of supplementing feature points based on the first feature points includes steps E11 to E14:

[0166] Step E11: Acquire multiple valid feature points other than the first feature points from the feature points of the entire image.

[0167] Optionally, the first feature point that is not obtained in the subsequent steps may be obtained from the full-image feature points extracted in the current frame as the valid feature point of step E11, that is, the valid feature point that is not selected is obtained.

[0168] Step E12: If the valid feature point is followed by at least a preset eighth threshold k1 of frames in the initialization frame, the three-dimensional coordinate information of the valid feature point is restored by a feature point triangulation algorithm.

[0169] The initialization frame is a preset number of image frames including the current frame acquired based on a preset interval within the sliding window. For an example of acquiring the initialization frame, reference may be made to the relevant content of step D1, which will not be described in detail in this application.

[0170] Among them, the 3D depth information of relevant valid feature points can be restored by the feature point triangulation algorithm. Specifically, the homogeneous coordinates of the feature points to be calculated are The homogeneous coordinates of the image observation point of the jth camera are z j =(u j ,v j ,1), the projection matrix is ​​P j =K[R j |t j ], the projection model is shown in the following formula (3):

[0171]

[0172] Among them, R j and t j For camera status Q j and P j ,K is the known camera intrinsic parameter.

[0173] Among them, Available Expanding it, it becomes the following formula (4):

[0174]

[0175] We get three equations, but in fact the third equation is a linear combination of the first two equations, as shown in the following formula (5):

[0176]

[0177] From the above formula, we can see that there are only two linearly independent equations for the feature point x i ,Each camera observation has two linear equations. The constraint equations of M (representing the number of observations at this point) camera observations are combined to obtain 2M linear equations, as shown in formula (6):

[0178]

[0179] By solving the homogeneous system of equations, we get That is, the 3D coordinates of the point are obtained. The above is the process of triangulating the feature points.

[0180] In the embodiment of the present application, the above-mentioned feature point triangulation operation may be performed on each feature point that needs to be restored.

[0181] Step E13: Acquire a fourth feature point M4 whose depth value meets preset requirements from the restored valid feature points.

[0182] The process of screening the restored valid feature points M3 based on the depth value can refer to the relevant example of step S202, and this application will not elaborate on it.

[0183] Step E14: Determine the third feature point and the fourth feature point as target feature points.

[0184] Among them, through the execution of the above steps, the number of target feature points M ba =M2+M4 (the sum of the third feature point and the fourth feature point).

[0185] Optionally, if the number of feature points after supplementation is M ba Still less than the threshold T featnum2 , then it is determined that the current initialization has failed and you can return to the first step, otherwise go to the next step.

[0186] In a feasible embodiment, the second initialization information includes at least one of camera pose information and three-dimensional coordinate information.

[0187] In step S203, the second initialization information of the target feature point in the current frame is determined based on the first initialization information by using the bundle adjustment method, including steps F1-F2:

[0188] Step F1: using the depth value in the three-dimensional coordinate information as a constraint parameter of a bundle adjustment method, and determining the second initialization information of the target feature point based on the first initialization information through the bundle adjustment method.

[0189] Step F2: The target feature points are eliminated based on preset elimination conditions. If the number of target feature points remaining after elimination is less than the preset ninth threshold, the initialization fails. Otherwise, when it is determined that the offset value indicated by the camera posture information is less than or equal to the preset tenth threshold, the initialization is determined to be successful.

[0190] In the embodiment of the present application, after the operation of step S202 and feature point supplementation, after having multiple camera positions and multiple observed map points, a global bundle adjustment (BA) optimization can be performed. The optimization items may include N camera states (P i ,Q i ,V i ,bg i ,ba i )i∈N,P i , Q i 、V i 、bgi ,ba i are the displacement, rotation, velocity, gyroscope bias and acceleration bias of camera frame i, and M ba 3D point coordinates Pf i , i∈M ba , followed by camera intrinsic parameters and camera-imu extrinsic parameters as optional optimization items. Among them, the constraints include the imu constraints between frames and the reprojection error constraints of map points. Among them, depth-weighted BA optimization is adopted in the embodiment of the present application. Different from the conventional reprojection error constraints in the related art, the embodiment of the present application uses the depth of the map point as a weight to adjust the size of the constraint item. In addition, considering that the relative observation at close range is more accurate, the pixel position of the feature point is more precise, and there is less occlusion, while the observation error of the far point is large and the depth accuracy is not high, the weight of the near point is increased in the optimization, and the weight of the far point is reduced. The weight is set to 1 / depth i *λ scale , where depth i is the depth of 3D feature point i in the current frame, λ scale To adjust the parameters.

[0191] Optionally, after completing BA optimization, map points can be removed again. The removal conditions include:

[0192] 1. The depth value is negative on the observation camera;

[0193] 2. The depth value is greater than the threshold multiple of the maximum baseline length of the camera;

[0194] 3. For large reprojection errors, the depth-weighted threshold is also considered here.

[0195] The number of map points eliminated by the above elimination conditions is less than the threshold T featnum3 , it is determined that the initialization has failed and you can return to the first step. Otherwise, perform a status judgment. If the bg and ba values ​​of the camera are large and greater than the empirical threshold, it is determined that the optimization result is poor. Otherwise, the initialization of this step is successful and you can proceed to the next operation step.

[0196] In a feasible embodiment, by executing the above steps, the state value (P i ,Q i ,V i ,bg i ,ba i ), for different vio systems, as an option, subsequent system status updates and other operations can be performed:

[0197] 1. If the camera imu internal and external parameters are optimized, the system internal and external parameter data will be updated;

[0198] 2. If the state covariance (information matrix) needs to be restored, the empirical value setting method can be used to avoid the complex calculation of restoring the covariance and improve the speed. This method is set up considering that the previous steps have provided high-quality and sufficient feature points, as well as multiple elimination operations. The initialization quality that can pass the verification and successfully run to the last step is usually high, so the covariance matrix with fixed parameter settings can be sufficient for subsequent system operation;

[0199] 3. If necessary Figure 3 The D feature points are used for subsequent follow-up optimization, and the successfully initialized 3D points are added to the VIO system so that subsequent update optimization can be performed directly to ensure the operational stability of the VIO system.

[0200] In the embodiments of the present application, from the perspective of application scenarios, Figure 5 As shown in the figure, in the AR scene, the operating object can see the virtual model placed in the real environment through the interactive interface by opening the AR function of the program (such as Figure 5 In addition, as shown in Figure 6 As shown, in the AR scene, the operating object can select a virtual model (such as Figure 6 The puppy shown in the figure is placed in a real environment (keyboard). The method provided in the embodiment of the present application can be applied to the initialization of the interface content of the operating object to start the AR function.

[0201] It should be noted that in the optional embodiments of the present application, the data involved (such as videos, image frames, camera pose information, etc.), when the above embodiments of the present application are applied to specific products or technologies, need to obtain permission or consent from the user, and the collection, use and processing of the relevant data need to comply with the relevant laws, regulations and standards of the relevant countries and regions. In other words, if the embodiments of the present application involve data related to the object, these data need to be obtained with the authorization and consent of the object and in compliance with the relevant laws, regulations and standards of the country and region.

[0202] The present application embodiment provides an information initialization device, such as Figure 7 As shown, the information initialization device 100 may include: an initialization module 101.

[0203] The initialization module 101 is used to obtain multiple first feature points of the current frame based on a preset feature point detection algorithm. If the duration and the number of feature points in the current sliding window are determined by a preset dynamic sliding window algorithm based on the first feature points to meet the preset initialization requirements, the following initialization operation is performed:

[0204] Based on the average pixel displacement of each of the first feature points within the sliding window, the first feature points are screened to obtain a plurality of second feature points;

[0205] Filtering out a third feature point whose depth value meets a preset requirement from the second feature points, and determining first initialization information of the third feature point;

[0206] The target feature point is determined based on the third feature point, and the second initialization information of the target feature point in the current frame is determined based on the first initialization information by using a bundle adjustment method.

[0207] In a feasible embodiment, when the initialization module 101 is used to execute a preset feature point detection algorithm to obtain a plurality of first feature points of the current frame, it is specifically used to:

[0208] Perform the following feature extraction operations on the current frame: extract features from the current frame based on a preset feature point detection algorithm to obtain a plurality of full-image feature points and a first response value of each full-image feature point; divide the current frame into grids based on a preset grid division strategy, and retain a full-image feature point with the highest first response value for each grid; obtain a plurality of first feature points from the retained full-image feature points, and perform feature tracking on the first feature points;

[0209] Or, if there is a previous frame of the current frame, and the number of feature points of the previous frame is greater than a preset first threshold, feature tracking is performed on the feature points of the previous frame, otherwise the feature extraction operation is performed.

[0210] In a feasible embodiment, when the initialization module 101 is used to retain a whole-image feature point with the highest first response value for each grid, it is specifically used to perform the following operations for each grid:

[0211] Obtaining the center position of the full-image feature point with the highest response value in each grid in the previous frame, obtaining a second response value based on the distance between each full-image feature point in the current grid of the current frame and the center position, and retaining the full-image feature point with the highest second response value;

[0212] If the current frame is the first frame, the full-image feature point with the highest first response value is retained.

[0213] In a feasible embodiment, when the initialization module 101 is used to obtain a plurality of first feature points from the retained full-image feature points, it is specifically used to:

[0214] If the number of the full-image feature points is greater than a preset second threshold, the following line feature deletion operation is performed for each full-image feature point:

[0215] Calculate the pixel difference of the feature points of the whole image in the horizontal and vertical directions of the image;

[0216] In a target area determined based on a preset pixel range, determining a gradient direction of each pixel point based on the pixel difference;

[0217] Determining a histogram including a plurality of check blocks based on the gradient direction, wherein the check blocks are determined based on preset check parameters;

[0218] If the gradient direction of the center point of the target area and the gradient direction with the highest number in the histogram indicate the same check block, and the highest number in the histogram is greater than the second highest number in the histogram by a preset third threshold, the feature point of the entire image is determined as a line feature and deleted.

[0219] In a feasible embodiment, when the initialization module 101 is used to perform, based on the first feature point, determining through a preset dynamic sliding window algorithm whether the duration and the number of feature points in the current sliding window meet the preset initialization requirements, it is specifically used to:

[0220] If the duration in the current sliding window is longer than the sliding window duration determined based on the average moving distance of the feature point pixels, determining whether the motion excitation indicated by the IMU data between the current frame and the previous frame is greater than a preset fourth threshold;

[0221] If yes, when the number of feature points in the current sliding window meets the preset number requirement, determining whether the duration and the number of feature points in the current sliding window meet the preset initialization requirement;

[0222] The determination of the sliding window duration includes:

[0223] Determining whether an average moving distance of feature point pixels of the first feature point in the current sliding window is greater than a preset fourth threshold based on a preset sliding window duration;

[0224] If yes, shorten the sliding window duration based on a preset duration range;

[0225] If not, the sliding window duration is increased based on the duration range.

[0226] In a feasible embodiment, determining the sliding window duration further includes:

[0227] Get the depth of field parameters corresponding to the last initialization failure;

[0228] If the depth of field parameter indicates that the depth of field of the current scene is greater than a preset fifth threshold, increasing the sliding window duration within the duration range;

[0229] If the depth of field parameter indicates that the depth of field of the current scene is less than or equal to the fifth threshold, the sliding window duration is shortened within the duration range.

[0230] In a feasible embodiment, when the initialization module 101 is used to perform the screening of the first feature points based on the average pixel displacement of each of the first feature points in the sliding window to obtain a plurality of second feature points, it is specifically used to:

[0231] Calculating the average pixel displacement of each of the first feature points within the sliding window based on the positions of the feature points obtained by feature tracking of each of the first feature points in the continuous frames of the video;

[0232] Acquire a plurality of second feature points with larger displacement from the first feature points based on the average pixel displacement;

[0233] The number of the second feature points is related to the average pixel displacement of the entire image determined by the average pixel displacement of all the first feature points; the larger the average pixel displacement of the entire image is, the larger the number of the second feature points is.

[0234] In a feasible embodiment, the first initialization information includes at least one of camera pose information and three-dimensional coordinate information; when the initialization module 101 is used to perform the operation of screening out a third feature point whose depth value meets the preset requirements from the second feature point and determining the first initialization information of the third feature point, it is specifically used to:

[0235] Acquire an initialization frame including the current frame based on a preset interval within the sliding window;

[0236] The following elimination operation is performed on each of the second feature points to obtain a third feature point whose depth value meets the preset requirements:

[0237] Calculate the camera pose information and three-dimensional space coordinate information of the second feature point in the initialization frame, where the camera pose information includes at least one of displacement information, rotation information, and speed information;

[0238] Determine the farthest movement distance of the second feature point in the initialization frame based on the displacement information;

[0239] If the depth value determined based on the farthest movement distance and the preset weight is less than the depth value indicated by the three-dimensional space coordinate information, the second feature point is removed.

[0240] In a feasible embodiment, when the initialization module 101 is used to determine the target feature point based on the third feature point, it is specifically used to:

[0241] If the number of the third feature points is less than a preset sixth threshold, feature points are supplemented based on the first feature points until the number of target feature points obtained reaches a preset seventh threshold;

[0242] If the number of the third feature points is greater than or equal to the sixth threshold, the third feature points are determined as target feature points.

[0243] In a feasible embodiment, when the initialization module 101 is used to perform feature point supplementation based on the first feature point, it is specifically used to:

[0244] Acquire multiple valid feature points other than the first feature points from the feature points of the entire image;

[0245] If the valid feature point is followed by at least a preset eighth threshold number of frames in the initialization frame, the three-dimensional coordinate information of the valid feature point is restored by a feature point triangulation algorithm;

[0246] Acquire a fourth feature point whose depth value meets the preset requirements from the restored valid feature points;

[0247] determining the third feature point and the fourth feature point as target feature points;

[0248] The initialization frame is a preset number of image frames including the current frame acquired within the sliding window based on a preset interval.

[0249] In a feasible embodiment, the second initialization information includes at least one of camera pose information and three-dimensional coordinate information; when the initialization module 101 is used to determine the second initialization information of the target feature point in the current frame based on the first initialization information by using the bundle adjustment method, it is specifically used to:

[0250] Using the depth value in the three-dimensional coordinate information as a constraint parameter of a bundle adjustment method, and determining second initialization information of the target feature point based on the first initialization information through the bundle adjustment method;

[0251] The target feature points are eliminated based on the preset elimination conditions. If the number of remaining target feature points after elimination is less than the preset ninth threshold, the initialization fails. Otherwise, when it is determined that the bias value indicated by the camera posture information is less than or equal to the preset tenth threshold, the initialization is determined to be successful.

[0252] The device of the embodiments of the present application can execute the method provided by the embodiments of the present application, and the implementation principles are similar. The actions performed by each module in the device of each embodiment of the present application correspond to the steps in the method of each embodiment of the present application. For the detailed functional description of each module of the device, please refer to the description in the corresponding method shown in the previous text, which will not be repeated here.

[0253] The modules involved in the embodiments described in this application can be implemented by software. The name of the module does not limit the module itself in some cases. For example, the initialization module can also be described as a "module for performing initialization operations", "a first module", etc.

[0254] The subject name information, category information, data interaction relationship, subject topology map, etc. involved in the embodiments of the present application can be stored through blockchain technology. The blockchain referred to in this application is a new application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods, each of which contains a certain amount of processed data for verifying the validity of its information (anti-counterfeiting) and generating the next block. The blockchain can include the underlying blockchain platform, the platform product service layer, and the application service layer.

[0255] In an embodiment of the present application, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory, the processor executes the above-mentioned computer program to implement the steps of the information initialization method, which can be implemented compared with the related art: first, based on a preset feature point detection algorithm, multiple first feature points of the current frame are obtained, and based on the first feature points, a preset dynamic sliding window algorithm is used to determine whether the duration and the number of feature points in the current sliding window meet the preset initialization requirements. The present application first processes the data association in the initialization window more effectively through robust feature point detection and sliding window strategy; then, when it is determined that the initialization requirements are met, the initialization operation is performed, specifically, firstly based on the average pixel displacement of each first feature point in the sliding window, the first feature points are screened to obtain multiple second feature points, and a third feature point whose depth value meets the preset requirements is screened from the second feature points, and the first initialization information of the third feature point is determined, and then the target feature point is determined based on the third feature point, and the second initialization information related to the target feature point is determined based on the first initialization information through the bundle adjustment method; that is, the present application utilizes a multi-stage system state solution method, and the implementation of this scheme can effectively improve the number and quality of the adopted feature points, optimize the dynamic initialization effect, and improve the initialization success rate and accuracy.

[0256] In an alternative embodiment, an electronic device is provided, such as Figure 8 As shown, Figure 8The electronic device 4000 shown includes: a processor 4001 and a memory 4003. The processor 4001 and the memory 4003 are connected, such as through a bus 4002. Optionally, the electronic device 4000 may also include a transceiver 4004, which may be used for data interaction between the electronic device and other electronic devices, such as data transmission and / or data reception. It should be noted that in actual applications, the transceiver 4004 is not limited to one, and the structure of the electronic device 4000 does not constitute a limitation on the embodiments of the present application.

[0257] Processor 4001 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. It may implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of this application. Processor 4001 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.

[0258] The bus 4002 may include a path to transmit information between the above components. The bus 4002 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The bus 4002 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 8 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0259] The memory 4003 may be a ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical disk storage, optical disk storage (including compressed optical disk, laser disk, optical disk, digital versatile disk, Blu-ray disk, etc.), magnetic disk storage media, other magnetic storage devices, or any other medium that can be used to carry or store computer programs and can be read by a computer, without limitation herein.

[0260] The memory 4003 is used to store the computer program for executing the embodiment of the present application, and the execution is controlled by the processor 4001. The processor 4001 is used to execute the computer program stored in the memory 4003 to implement the steps shown in the above method embodiment.

[0261] Among them, electronic equipment includes but is not limited to: terminals.

[0262] An embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps and corresponding contents of the aforementioned method embodiment can be implemented.

[0263] The embodiment of the present application also provides a computer program product, including a computer program, which can implement the steps and corresponding contents of the aforementioned method embodiment when executed by a processor.

[0264] The terms "first", "second", "third", "fourth", "1", "2", etc. (if any) in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than that shown or described in the drawings.

[0265] It should be understood that, although each operation step is indicated by arrows in the flowchart of the embodiment of the present application, the implementation order of these steps is not limited to the order indicated by the arrows. Unless clearly stated herein, in some implementation scenarios of the embodiment of the present application, the implementation steps in each flowchart can be performed in other orders according to demand. In addition, some or all of the steps in each flowchart may include multiple sub-steps or multiple stages based on actual implementation scenarios. Some or all of these sub-steps or stages may be executed at the same time, and each sub-step or stage in these sub-steps or stages may also be executed at different times respectively. In different scenarios of execution time, the execution order of these sub-steps or stages may be flexibly configured according to demand, and the embodiment of the present application does not limit this.

[0266] The above is only an optional implementation method for some implementation scenarios of the present application. It should be pointed out that for ordinary technicians in this technical field, without departing from the technical concept of the solution of the present application, other similar implementation methods based on the technical ideas of the present application are also within the protection scope of the embodiments of the present application.

Claims

1. An information initialization method, characterized in that: include: Based on a preset feature point detection algorithm, a plurality of first feature points of the current frame are obtained. If, based on the first feature points, a preset dynamic sliding window algorithm is used to determine that the duration and the number of feature points in the current sliding window meet the preset initialization requirements, the following initialization operation is performed: Based on the average pixel displacement of each of the first feature points within the sliding window, the first feature points are screened to obtain a plurality of second feature points; Filtering out a third feature point whose depth value meets a preset requirement from the second feature points, and determining first initialization information of the third feature point; The target feature point is determined based on the third feature point, and the second initialization information of the target feature point in the current frame is determined based on the first initialization information by using a bundle adjustment method.

2. The method according to claim 1, characterized in that: The acquiring a plurality of first feature points of the current frame based on a preset feature point detection algorithm includes: Perform the following feature extraction operations on the current frame: extract features from the current frame based on a preset feature point detection algorithm to obtain a plurality of full-image feature points and a first response value of each full-image feature point; divide the current frame into grids based on a preset grid division strategy, and retain a full-image feature point with the highest first response value for each grid; obtain a plurality of first feature points from the retained full-image feature points, and perform feature tracking on the first feature points; Or, if there is a previous frame of the current frame, and the number of feature points of the previous frame is greater than a preset first threshold, feature tracking is performed on the feature points of the previous frame, otherwise the feature extraction operation is performed.

3. The method according to claim 2, characterized in that The step of retaining a whole-image feature point with the highest first response value for each grid includes performing the following operations for each grid: Obtaining the center position of the full-image feature point with the highest response value in each grid in the previous frame, obtaining a second response value based on the distance between each full-image feature point in the current grid of the current frame and the center position, and retaining the full-image feature point with the highest second response value; If the current frame is the first frame, the full-image feature point with the highest first response value is retained.

4. The method according to claim 2, characterized in that: The step of obtaining a plurality of first feature points from the retained full-image feature points includes: If the number of the full-image feature points is greater than a preset second threshold, the following line feature deletion operation is performed for each full-image feature point: Calculate the pixel difference of the feature points of the whole image in the horizontal and vertical directions of the image; In a target area determined based on a preset pixel range, determining a gradient direction of each pixel point based on the pixel difference; Determining a histogram including a plurality of check blocks based on the gradient direction, wherein the check blocks are determined based on preset check parameters; If the gradient direction of the center point of the target area and the gradient direction with the highest number in the histogram indicate the same check block, and the highest number in the histogram is greater than the second highest number in the histogram by a preset third threshold, the feature point of the entire image is determined as a line feature and deleted.

5. The method according to claim 1, characterized in that The determining, based on the first feature point, through a preset dynamic sliding window algorithm, whether the duration and the number of feature points in the current sliding window meet a preset initialization requirement includes: If the duration in the current sliding window is longer than the sliding window duration determined based on the average moving distance of the feature point pixels, determining whether the motion excitation indicated by the IMU data between the current frame and the previous frame is greater than a preset fourth threshold; If yes, when the number of feature points in the current sliding window meets the preset number requirement, determining whether the duration and the number of feature points in the current sliding window meet the preset initialization requirement; The determination of the sliding window duration includes: Determining whether an average moving distance of feature point pixels of the first feature point in the current sliding window is greater than a preset fourth threshold based on a preset sliding window duration; If yes, shorten the sliding window duration based on a preset duration range; If not, the sliding window duration is increased based on the duration range.

6. The method according to claim 5, characterized in that The determination of the sliding window duration also includes: Get the depth of field parameters corresponding to the last initialization failure; If the depth of field parameter indicates that the depth of field of the current scene is greater than a preset fifth threshold, increasing the sliding window duration within the duration range; If the depth of field parameter indicates that the depth of field of the current scene is less than or equal to the fifth threshold, the sliding window duration is shortened within the duration range.

7. The method according to claim 1 or 2, characterized in that: The first feature points are screened based on the average pixel displacement of each of the first feature points in the sliding window to obtain a plurality of second feature points, including: Calculating the average pixel displacement of each of the first feature points within the sliding window based on the positions of the feature points obtained by feature tracking of each of the first feature points in the continuous frames of the video; Acquire a plurality of second feature points with larger displacement from the first feature points based on the average pixel displacement; The number of the second feature points is related to the average pixel displacement of the entire image determined by the average pixel displacement of all the first feature points; the larger the average pixel displacement of the entire image is, the larger the number of the second feature points is.

8. The method according to claim 1, characterized in that The first initialization information includes at least one of camera pose information and three-dimensional coordinate information; The step of selecting a third feature point whose depth value meets a preset requirement from the second feature point and determining first initialization information of the third feature point includes: Acquire an initialization frame including the current frame based on a preset interval within the sliding window; The following elimination operation is performed on each of the second feature points to obtain a third feature point whose depth value meets the preset requirements: Calculate the camera pose information and three-dimensional space coordinate information of the second feature point in the initialization frame, where the camera pose information includes at least one of displacement information, rotation information, and speed information; Determine the farthest movement distance of the second feature point in the initialization frame based on the displacement information; If the depth value determined based on the farthest movement distance and the preset weight is less than the depth value indicated by the three-dimensional space coordinate information, the second feature point is removed.

9. The method according to claim 2, characterized in that: The determining the target feature point based on the third feature point comprises: If the number of the third feature points is less than a preset sixth threshold, feature points are supplemented based on the first feature points until the number of target feature points obtained reaches a preset seventh threshold; If the number of the third feature points is greater than or equal to the sixth threshold, the third feature points are determined as target feature points.

10. The method according to claim 9, characterized in that The supplementing feature points based on the first feature points includes: Acquire multiple valid feature points other than the first feature points from the feature points of the entire image; If the valid feature point is followed by at least a preset eighth threshold number of frames in the initialization frame, the three-dimensional coordinate information of the valid feature point is restored by a feature point triangulation algorithm; Acquire a fourth feature point whose depth value meets the preset requirements from the restored valid feature points; determining the third feature point and the fourth feature point as target feature points; The initialization frame is a preset number of image frames including the current frame acquired within the sliding window based on a preset interval.

11. The method according to claim 1, characterized in that: The second initialization information includes at least one of camera pose information and three-dimensional coordinate information; The step of determining the second initialization information of the target feature point in the current frame based on the first initialization information by using the bundle adjustment method includes: Using the depth value in the three-dimensional coordinate information as a constraint parameter of a bundle adjustment method, and determining second initialization information of the target feature point based on the first initialization information through the bundle adjustment method; The target feature points are eliminated based on the preset elimination conditions. If the number of remaining target feature points after elimination is less than the preset ninth threshold, the initialization fails. Otherwise, when it is determined that the bias value indicated by the camera posture information is less than or equal to the preset tenth threshold, the initialization is determined to be successful.

12. An information initialization device, characterized in that: include: An initialization module is used to obtain multiple first feature points of the current frame based on a preset feature point detection algorithm. If, based on the first feature points, the duration and the number of feature points in the current sliding window are determined by a preset dynamic sliding window algorithm to meet the preset initialization requirements, the following initialization operation is performed: Based on the average pixel displacement of each of the first feature points within the sliding window, the first feature points are screened to obtain a plurality of second feature points; Filtering out a third feature point whose depth value meets a preset requirement from the second feature points, and determining first initialization information of the third feature point; The target feature point is determined based on the third feature point, and the second initialization information of the target feature point in the current frame is determined based on the first initialization information by using a bundle adjustment method.

13. An electronic device comprising a memory, a processor and a computer program stored in the memory, characterized in that: The processor executes the computer program to implement the steps of the method according to any one of claims 1 to 11.

14. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 11 are implemented.

15. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 11 are implemented.