Vehicle pose detection method and device, electronic equipment and storage medium
By using a vehicle position detection model of feature point pair extraction, feature vector extraction and clustering operations in vehicle position detection, the problems of low computational efficiency and insufficient robustness of vehicle position detection in the prior art are solved, and the effect of improving detection efficiency and accuracy is achieved.
Patent Information
- Application Number
- CN202411553953.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-01
- Publication Date
- 2025-02-25
AI Technical Summary
In the prior art, the calculation efficiency of vehicle position detection is low and the robustness is insufficient, especially in extreme environments, resulting in low accuracy and efficiency of vehicle position detection.
The vehicle position detection model is used to detect the initial position image and the target position image. Through feature point pair extraction, feature vector extraction and clustering operations, the change information of the vehicle position posture is determined. The model determines the detection result based on the clustering results of the feature vector, which is determined based on the initial position image and the target position image.
By combining image matching technology and clustering algorithm, real-time and accurate acquisition of vehicle position change information is achieved, the efficiency and accuracy of vehicle position detection are improved, and the detection problem caused by low registration accuracy is solved.
Smart Images

Figure CN119509513A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of vehicle posture detection, and in particular to a vehicle posture detection method, device, electronic equipment and storage medium. Background Art
[0002] With the rapid development of autonomous driving technology, the automotive visual perception system has become a key component for realizing autonomous driving functions. The visual perception system captures images of the vehicle during driving through a camera, and uses an image matching algorithm to calculate the changes in the vehicle's posture during driving to determine the vehicle's precise position in the environment. Among the existing technologies, the scale-invariant feature transform (SIFT) algorithm is a widely used image matching technology. However, the calculation process of the SIFT algorithm is relatively complicated and has the following problems:
[0003] (1) Low computational efficiency: The SIFT algorithm needs to perform multi-scale and multi-directional filtering operations when processing images, which makes it disadvantageous in processing speed, especially in autonomous driving scenarios that require real-time processing of large amounts of image data, resulting in low efficiency in vehicle posture detection.
[0004] (2) Lack of robustness: Although the SIFT algorithm is scale and rotation invariant to a certain extent, its robustness is still insufficient in extreme environments (such as lighting changes, occlusion, etc.), which will lead to failure in key point extraction and matching, resulting in low accuracy of vehicle pose detection.
[0005] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0006] The embodiments of the present invention provide a vehicle posture detection method, device, electronic device and storage medium to at least solve the technical problem in the related art that the vehicle posture detection accuracy and efficiency are low due to the low registration accuracy of the vehicle's initial position image and target position image.
[0007] According to one embodiment of the present invention, a vehicle posture detection method is provided, comprising: acquiring an initial position image and a target position image of a target vehicle; detecting the initial position image and the target position image using a vehicle posture detection model to obtain a detection result of the vehicle posture, wherein the detection result is used to determine change information of the vehicle posture, and the vehicle posture detection model determines the detection result based on a clustering result of a feature vector, and the feature vector is determined based on the initial position image and the target position image.
[0008] Optionally, the vehicle posture detection model includes a feature point pair extraction module, a feature vector extraction module and a feature vector clustering module. The vehicle posture detection model is used to detect the initial position image and the target position image, and the detection result of the vehicle posture includes: using the feature point pair extraction module to extract features of the initial position image and the target position image to obtain feature point pairs; using the feature vector extraction module to extract vectors from the feature point pairs to obtain feature vectors; using the feature vector clustering module to perform clustering operations on the feature vectors to obtain target feature vectors; determining the detection result based on the target feature vector and the initial position image.
[0009] Optionally, a feature point pair extraction module is used to perform feature extraction on the initial position image and the target position image to obtain a feature point pair, including: using a preset image detection algorithm to extract feature points in the initial position image to obtain a first feature point; using a preset image detection algorithm to extract feature points in the target position image to obtain a second feature point; using a preset matching algorithm to match the first feature point and the second feature point to obtain a feature point pair.
[0010] Optionally, the feature vector includes a paradigm feature vector and a gradient feature vector, and the feature vector extraction module is used to extract vectors from feature point pairs to obtain the feature vector, including: constructing a feature point pair vector based on the feature point pairs; performing a paradigm operation on the feature point pair vector pair to obtain a paradigm feature vector; performing a gradient operation on the feature point pair vector to obtain a gradient feature vector.
[0011] Optionally, a feature vector clustering module is used to perform a clustering operation on the feature vector to obtain a target feature vector, including: obtaining an initial cluster center and distance information from the feature vector to the initial cluster center; allocating feature vectors based on the distance information; updating the cluster center based on the difference between the feature vector and the initial cluster center; in response to the cluster center satisfying a preset convergence condition, filtering the target feature vector based on the cluster center.
[0012] Optionally, determining the detection result based on the target feature vector and the initial position image includes: establishing an affine transformation equation using the target feature vector; solving the affine transformation equation to obtain an affine transformation matrix; and determining the detection result using the affine transformation matrix and the first feature point.
[0013] According to one embodiment of the present invention, a vehicle posture detection device is also provided, including: an acquisition module, used to acquire an initial position image and a target position image of a vehicle; a detection module, used to detect the initial position image and the target position image using a vehicle posture detection model to obtain a detection result of the vehicle posture, wherein the detection result is used to determine change information of the vehicle posture, and the vehicle posture detection model determines the detection result based on clustering feature vectors, and the feature vectors are determined based on the initial position image and the target position image.
[0014] Optionally, the detection module is also used to: use the feature point pair extraction module to perform feature extraction on the initial position image and the target position image to obtain feature point pairs; use the feature vector extraction module to perform vector extraction on the feature point pairs to obtain feature vectors; use the feature vector clustering module to perform clustering operations on the feature vectors to obtain target feature vectors; determine the detection results based on the target feature vector and the initial position image.
[0015] Optionally, the vehicle posture detection device also includes an extraction module, which is used to: the acquisition module uses a preset image detection algorithm to extract feature points in the initial position image to obtain a first feature point; uses a preset image detection algorithm to extract feature points in the target position image to obtain a second feature point; uses a preset matching algorithm to match the first feature point and the second feature point to obtain a feature point pair.
[0016] Optionally, the vehicle posture detection device also includes a processing module, which is used to: construct a feature point pair vector based on the feature point pair; perform a normal form operation on the feature point pair vector pair to obtain a normal form feature vector; perform a gradient operation on the feature point pair vector to obtain a gradient feature vector.
[0017] Optionally, the acquisition module is also used to obtain the initial cluster center and the distance information from the feature vector to the initial cluster center; the processing module is also used to: assign feature vectors based on the distance information; update the cluster center based on the difference between the feature vector and the initial cluster center; in response to the cluster center satisfying a preset convergence condition, filter the target feature vector based on the cluster center.
[0018] Optionally, the vehicle posture detection device also includes a determination module, which is used to: establish an affine transformation equation using the target feature vector; solve the affine transformation equation to obtain an affine transformation matrix; and determine the detection result using the affine transformation matrix and the first feature point.
[0019] According to one embodiment of the present invention, there is also provided an electronic device, comprising: a memory storing an executable program; and a processor for running the program, wherein the above-mentioned vehicle posture detection method is implemented when the program is running.
[0020] According to one embodiment of the present invention, a computer-readable storage medium is also provided, the computer-readable storage medium including a stored executable program, wherein when the executable program is running, the device where the storage medium is located is controlled to execute the above-mentioned vehicle posture detection method.
[0021] According to one embodiment of the present invention, a computer program product is also provided, including a computer program, and the computer program implements the above-mentioned vehicle posture detection method when executed by a processor.
[0022] In an embodiment of the present invention, a method of acquiring an initial position image and a target position image of a target vehicle is adopted, and the initial position image and the target position image are detected using a vehicle posture detection model to obtain a detection result of the vehicle posture, wherein the detection result is used to determine the change information of the vehicle posture, and the vehicle posture detection model determines the detection result based on the clustering result of the feature vector, and the feature vector is determined based on the initial position image and the target position image, thereby achieving the purpose of combining image matching technology and clustering algorithm to obtain the change information of the vehicle posture in real time and accurately, thereby achieving the technical effect of improving the efficiency and accuracy of vehicle posture detection, and further solving the technical problem of low accuracy and efficiency of vehicle posture detection due to low registration accuracy of the vehicle's initial position image and target position image in the related art. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0024] Figure 1 is a flow chart of a vehicle posture detection method according to one embodiment of the present invention;
[0025] Figure 2 is a flow chart of another vehicle posture detection method according to one embodiment of the present invention;
[0026] Figure 3 It is a structural block diagram of a vehicle posture detection device according to one embodiment of the present invention. DETAILED DESCRIPTION
[0027] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0028] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0029] According to an embodiment of the present invention, a method embodiment of a vehicle posture detection method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0030] The method embodiment can be executed in an electronic device or a similar computing device including a memory and a processor. Taking running on a vehicle terminal as an example, the vehicle terminal may include one or more processors (the processor may include but is not limited to a central processing unit (CPU), a graphics processing unit (GPU), a digital signal processing (DSP) chip, a microcontroller unit (MCU), a programmable logic device (Field Programmable Gate Array, FPGA), a neural network processor (Neural-network Processor Unit, NPU), a tensor processor (Tensor Processing Unit, TPU), an artificial intelligence (Artificial Intelligence, AI) type processor, etc.) and a memory for storing data. Optionally, the above-mentioned vehicle terminal may also include a transmission device, an input and output device, and a display device for communication functions. It can be understood by those skilled in the art that the above-mentioned structural description is only for illustration and does not limit the structure of the above-mentioned vehicle terminal. For example, the vehicle terminal may also include more or fewer components than the above-mentioned structural description, or have a configuration different from the above-mentioned structural description.
[0031] The memory can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the vehicle posture detection method in the embodiment of the present invention. The processor executes various functional applications and data processing by running the computer program stored in the memory, that is, the above-mentioned vehicle posture detection method is realized. The memory may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include a memory remotely arranged relative to the processor, and these remote memories can be connected to the mobile terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0032] The transmission device is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device can be a radio frequency (Radio Frequency, referred to as RF) module, which is used to communicate with the Internet wirelessly.
[0033] The display device may be, for example, a touch screen type liquid crystal display (LCD) and a touch display (also referred to as a "touch screen" or "touch display screen"). The liquid crystal display may enable the user to interact with the user interface of the mobile terminal. In some embodiments, the mobile terminal has a graphical user interface (GUI), and the user may interact with the GUI by finger contacts and / or gestures on the touch-sensitive surface. The human-computer interaction functions here may optionally include the following interactions: creating web pages, drawing, word processing, making electronic documents, games, video conferencing, instant messaging, sending and receiving emails, call interfaces, playing digital videos, playing digital music and / or web browsing, etc. The executable instructions for executing the above human-computer interaction functions are configured / stored in a computer program product or readable storage medium executable by one or more processors.
[0034] Figure 1 is a flow chart of a vehicle posture detection method according to one embodiment of the present invention. Figure 1 As shown, the method comprises the following steps:
[0035] Step S10, acquiring an initial position image and a target position image of the target vehicle;
[0036] In step S10, the target vehicle is used to characterize the vehicles around the current vehicle. For example, when the driver is driving the current vehicle, the initial position image and the target position image of the vehicle located in front of the current vehicle are obtained.
[0037] The above-mentioned initial position image and target position image include but are not limited to: the target vehicle, the road condition information around the vehicle, and the environmental information around the vehicle. The timestamp of obtaining the initial position image is earlier than or equal to the timestamp of obtaining the target position image. The initial position image is used as the reference image.
[0038] Step S12, using the vehicle posture detection model to detect the initial position image and the target position image to obtain the detection result of the vehicle posture, wherein the detection result is used to determine the change information of the vehicle posture, and the vehicle posture detection model determines the detection result based on the clustering result of the feature vector, and the feature vector is determined based on the initial position image and the target position image.
[0039] In step S12, the above-mentioned vehicle posture change information includes translation information and rotation information of the target vehicle.
[0040] The above detection results are used to characterize the change process of the target vehicle's posture from the initial position image to the target position image. The current vehicle's automatic driving system can understand the change of the target vehicle's posture in the environment based on the detection results, so as to make correct driving decisions.
[0041] In the above vehicle posture detection model, an improved K-means clustering algorithm is used to cluster the feature vectors to obtain clustering results, and the detection results are determined according to the clustering results.
[0042] Specifically, a camera or other sensor is used to capture the initial position image and the target position image of the target vehicle. In the vehicle posture detection model, first, the collected initial position image and target position image are preprocessed to improve the accuracy of subsequent vehicle posture detection. For example, image preprocessing methods such as filtering, noise reduction, and scaling. Next, a machine learning or deep learning algorithm is used to identify the target vehicle in the initial position image and the target position image. Then, a feature extraction method (Speeded Up Robust Features, SURF) is used to extract the feature point pairs of the target vehicle in the initial position image and the target position image, and the feature point pairs are vectorized to obtain feature vectors. Finally, the K-means clustering algorithm is used to cluster the feature vectors to obtain clustering results, and the detection results are determined based on the clustering results.
[0043] Based on the above steps S10 to S12, the initial position image and the target position image of the target vehicle are obtained, and the initial position image and the target position image are detected using a vehicle posture detection model to obtain a detection result of the vehicle posture, wherein the detection result is used to determine the change information of the vehicle posture, and the vehicle posture detection model determines the detection result based on the clustering result of the feature vector, and the feature vector is determined based on the initial position image and the target position image, thereby achieving the purpose of combining image matching technology and clustering algorithm to obtain the change information of the vehicle posture in real time and accurately, thereby achieving the technical effect of improving the efficiency and accuracy of vehicle posture detection, and further solving the technical problem of low accuracy and efficiency of vehicle posture detection due to low registration accuracy of the vehicle's initial position image and target position image in the related art.
[0044] Optionally, the vehicle posture detection model includes a feature point pair extraction module, a feature vector extraction module and a feature vector clustering module. In step S12, the initial position image and the target position image are detected using the vehicle posture detection model, and the vehicle posture detection result obtained includes:
[0045] Step S121, using a feature point pair extraction module to extract features from the initial position image and the target position image to obtain feature point pairs;
[0046] Step S122, using a feature vector extraction module to extract vectors from feature point pairs to obtain feature vectors;
[0047] Step S123, using a feature vector clustering module to perform a clustering operation on the feature vector to obtain a target feature vector;
[0048] Step S124, determining the detection result based on the target feature vector and the initial position image.
[0049] Specifically, first, the collected initial position image and target position image are preprocessed. Then, a machine learning or deep learning algorithm is used to identify the target vehicle in the initial position image and the target position image. Then, the feature point pairs of the target vehicle in the initial position image and the target position image are extracted using the feature extraction method (Speeded Up Robust Features, SURF). Then, the norm of the feature point pairs is calculated to obtain the norm feature vector of the feature point pairs, and the gradient of the feature point pairs is calculated to obtain the gradient feature vector. Then, the improved K-means clustering algorithm is used to cluster the feature vectors to obtain the clustering results, wherein the feature vectors are used to construct the data points corresponding to the feature point pairs. Check the number of data points contained in each cluster, take the cluster center containing the largest number of data points as the target cluster center, and take the data points contained in the target cluster center as the target data points. Take the feature vector corresponding to the target data point as the target feature vector. Finally, the selected feature point pairs are determined according to the target feature vector, and the affine transformation matrix is established using the selected feature point pairs. The affine transformation equation is solved to obtain the affine transformation matrix; the detection result is determined using the affine transformation matrix and the initial position image.
[0050] Based on the above steps S121 to S124, a feature point pair extraction module is used to extract features from the initial position image and the target position image to obtain feature point pairs; a feature vector extraction module is used to extract vectors from the feature point pairs to obtain feature vectors; a feature vector clustering module is used to cluster the feature vectors to obtain target feature vectors; and a detection result is determined based on the target feature vector and the initial position image, thereby achieving the purpose of combining image matching technology and clustering algorithm to obtain real-time and accurate information on changes in vehicle posture, thereby achieving the technical effect of improving the efficiency and accuracy of vehicle posture detection, and further solving the technical problem in related technologies of low accuracy and efficiency of vehicle posture detection due to low registration accuracy of the vehicle's initial position image and target position image.
[0051] Optionally, in step S121, a feature point pair extraction module is used to extract features from the initial position image and the target position image, and the feature point pairs obtained include:
[0052] Step S1211, extracting feature points in the initial position image using a preset image detection algorithm to obtain first feature points;
[0053] In step S1211, the above-mentioned preset image detection algorithm is used to characterize the SURF algorithm.
[0054] Step S1212, extracting feature points in the target position image using a preset image detection algorithm to obtain second feature points;
[0055] Specifically, the SURF detector is initialized using the library function of the SURF algorithm. During this process, the parameters required by the SURF detector can be set. For example, the number of layers in the scale space, the minimum and maximum scales of the feature points, the Hessian matrix threshold, etc. The SURF algorithm is used to detect feature points in the preset area of the target vehicle in the initial position image and the target position image respectively. The SURF algorithm will look for key points at multiple scales in the initial position image and the target position image as feature points. For the detected feature points, the SURF algorithm is used to generate a descriptor, where the descriptor is a description of the area around the feature point for subsequent feature matching.
[0056] Step S1213: Use a preset matching algorithm to match the first feature point and the second feature point to obtain a feature point pair.
[0057] In step S1213, the preset matching algorithm is used to characterize matching algorithms such as Fast Nearest Neighbor Library (FLANN) and BFMatcher.
[0058] Specifically, a matching algorithm such as FLANN or BFMatcher is used to match the feature point descriptor of the initial position image with the feature point descriptor of the target position image, and N feature point pairs are selected from the matching results, which have similar features in the two images.
[0059] Based on the above steps S1211 to S1213, the feature points in the image at the initial position are extracted using a preset image detection algorithm to obtain the first feature point; the feature points in the image at the target position are extracted using a preset image detection algorithm to obtain the second feature point; the first feature point and the second feature point are matched using a preset matching algorithm to obtain a feature point pair. The SURF algorithm is robust to rotation, scale scaling, and partial brightness changes, and can accurately identify and match feature points even under variable environmental changes. Using matching algorithms such as FLANN or BFMatcher can quickly find matches in a large number of feature points, thereby improving the algorithm processing speed.
[0060] Optionally, the feature vector includes a paradigm feature vector and a gradient feature vector. In step S122, a feature vector extraction module is used to extract vectors from feature point pairs, and the obtained feature vector includes:
[0061] Step S1221, constructing a feature point pair vector based on the feature point pair;
[0062] Specifically, based on the N feature point pairs, N 1×4 feature point pair vectors Ax=[Mx My Nx Ny] are constructed, where Mx and My represent the x and y coordinates of the selected feature points in the initial position image, and Nx and Ny represent the x and y coordinates of the corresponding feature points in the target position image.
[0063] Step S1222, performing a normal form operation on the feature point vector pair to obtain a normal form feature vector;
[0064] Specifically, calculate the bi-norm of the feature point vector pair and let it be the feature vector , where the eigenvector As shown in expression (1).
[0065] (1)
[0066] Wherein, M represents the coordinates of the feature points selected in the initial position image; N represents the coordinates of the feature points selected in the target position image.
[0067] Step S1223, performing gradient operation on the feature point vector to obtain a gradient feature vector.
[0068] Specifically, calculate the bi-norm of the feature point vector pair and let it be the feature vector , where the eigenvector As shown in expression (2).
[0069] (2)
[0070] Wherein, Mx and My represent the x and y coordinates of the selected feature point in the initial position image, respectively, and Nx and Ny represent the x and y coordinates of the corresponding feature point in the target position image, respectively.
[0071] Based on the above steps S1221 to S1223, a feature point pair vector is constructed according to the feature point pairs; a paradigm operation is performed on the feature point pair vector pair to obtain a paradigm feature vector; a gradient operation is performed on the feature point pair vector to obtain a gradient feature vector. The paradigm feature vector and the gradient feature vector provide richer information to describe the relationship between the feature point pairs, including their positions and changing trends, and the paradigm and gradient information help to distinguish subtle differences between similar feature point pairs, thereby improving the accuracy of feature matching.
[0072] Optionally, in step S123, a feature vector clustering module is used to perform a clustering operation on the feature vector to obtain a target feature vector including:
[0073] Step S1231, obtaining the initial cluster center and the distance information from the feature vector to the initial cluster center;
[0074] Specifically, for each feature point pair corresponding to the feature vector and , so that it constitutes a data point . Randomly select k points from the data points as the initial cluster centers, and calculate the distance information between each data point and each cluster center.
[0075] Step S1232, allocating feature vectors based on distance information;
[0076] Specifically, for data points other than the initial cluster center, find the cluster center with the smallest distance to it and assign it to the cluster center.
[0077] Step S1233, updating the cluster center based on the difference between the feature vector and the initial cluster center;
[0078] Specifically, the cluster center is updated based on expression (3).
[0079] (3)
[0080] in, Represents the feature vector and The data points composed of SJ are a D-dimensional sphere with a radius of h; J represents the number of data points belonging to the current cluster center.
[0081] Furthermore, for each cluster center, the average of all data points assigned to it is calculated, and the position of the cluster center is updated according to the average value.
[0082] Step S1234, in response to the cluster center satisfying a preset convergence condition, screening the target feature vector based on the cluster center.
[0083] Specifically, for the updated cluster center, the average value of all data points assigned to it is calculated again according to expression (3), and the position of the cluster center is updated according to the average value. Clustering is performed in this way until the position of the cluster center no longer changes, or the change amount is less than a preset threshold, and then the cluster center is stopped from being updated. Check the number of data points contained in each cluster, and take the cluster center containing the largest number of data points as the target cluster center, and take the data points contained in the target cluster center as the target data points. The feature vector corresponding to the target data point is taken as the target feature vector.
[0084] Based on the above steps S1231 to S1234, the distance information from the initial cluster center and the feature vector to the initial cluster center is obtained; the feature vector is allocated based on the distance information; the cluster center is updated based on the difference between the feature vector and the initial cluster center; in response to the cluster center satisfying the preset convergence condition, the target feature vector is filtered based on the cluster center, which can quickly identify feature vectors with similarities in a large number of data points, reduce the amount of calculation for subsequent processing, and help to identify and filter out abnormal or noise data points, thereby enhancing the robustness of the vehicle posture detection method.
[0085] Optionally, in step S124, determining the detection result based on the target feature vector and the initial position image includes:
[0086] Step S1241, establishing an affine transformation equation using the target feature vector;
[0087] Step S1242, solving the affine transformation equation to obtain an affine transformation matrix;
[0088] Step S1243, determining the detection result using the affine transformation matrix and the first feature point.
[0089] Specifically, the selected feature point pairs are determined according to the target feature vector, and the affine transformation equations are established using the selected feature point pairs. For each pair of feature points, an affine transformation equation is established. The affine transformation equation usually includes parameters such as translation, rotation and scaling. The affine transformation equations of all feature point pairs are combined into a linear equation group. The linear equation group is solved using a numerical method (such as the least squares method) to obtain the parameters of the affine transformation matrix. According to the parameters obtained by the solution, an affine transformation matrix is formed. The affine transformation matrix is applied to the first feature point of the initial position image, and the position of the first feature point after the transformation is calculated. The transformed feature point position is compared with the actual position in the current image to verify the accuracy of the affine transformation. And according to the affine transformation matrix, the translation distance and rotation angle of the target vehicle from the initial position image to the target position image can be determined, thereby determining the position change of the target vehicle.
[0090] Based on the above steps S1241 to S1242, an affine transformation equation is established using the target feature vector; the affine transformation equation is solved to obtain an affine transformation matrix; the detection result is determined using the affine transformation matrix and the first feature point. By using the target feature vector, the feature point pairs between images can be accurately identified and tracked, thereby improving the accuracy of pose estimation. The affine transformation matrix can well handle rotation and translation changes between images, making the detection result more stable and robust, and able to adapt to different environments and conditions, thereby improving the accuracy and efficiency of vehicle pose detection.
[0091] Figure 2 is a flow chart of another vehicle posture detection method according to one embodiment of the present invention. Figure 2 As shown, the method comprises the following steps:
[0092] Step S201, acquiring an initial position image and a target position image of a target vehicle;
[0093] Step S202, extracting feature points in the image at the initial position using a preset image detection algorithm to obtain first feature points;
[0094] Step S203, extracting feature points in the target position image using a preset image detection algorithm to obtain second feature points;
[0095] Step S204, using a preset matching algorithm to match the first feature point and the second feature point to obtain a feature point pair;
[0096] Step S205, constructing a feature point pair vector based on the feature point pair;
[0097] Step S206, performing a normal form operation on the feature point vector pair to obtain a normal form feature vector;
[0098] Step S207, performing gradient operation on the feature point vector to obtain a gradient feature vector;
[0099] Step S208, obtaining the initial cluster center and the distance information from the feature vector to the initial cluster center;
[0100] Step S209, allocating feature vectors based on distance information;
[0101] Step S210, updating the cluster center based on the difference between the feature vector and the initial cluster center;
[0102] Step S211, in response to the cluster center satisfying a preset convergence condition, screening a target feature vector based on the cluster center;
[0103] Step S212, establishing an affine transformation equation using the target feature vector;
[0104] Step S213, solving the affine transformation equation to obtain an affine transformation matrix;
[0105] Step S214: Determine the detection result using the affine transformation matrix and the first feature point.
[0106] Based on the above steps S201 to S214, the initial position image and the target position image of the target vehicle are obtained, and the initial position image and the target position image are detected using a vehicle posture detection model to obtain a detection result of the vehicle posture, wherein the detection result is used to determine the change information of the vehicle posture, and the vehicle posture detection model determines the detection result based on the clustering result of the feature vector, and the feature vector is determined based on the initial position image and the target position image, thereby achieving the purpose of combining image matching technology and clustering algorithm to obtain the change information of the vehicle posture in real time and accurately, thereby achieving the technical effect of improving the efficiency and accuracy of vehicle posture detection, and further solving the technical problem of low accuracy and efficiency of vehicle posture detection due to low registration accuracy of the vehicle's initial position image and target position image in the related technology.
[0107] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present invention.
[0108] In an embodiment of the present invention, a vehicle posture detection device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware for a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0109] Figure 3 FIG. 1 is a structural block diagram of a vehicle posture detection device according to one embodiment of the present invention. Figure 3 As shown, the device comprises:
[0110] An acquisition module 301 is used to acquire an initial position image and a target position image of a vehicle;
[0111] The detection module 302 is used to detect the initial position image and the target position image using the vehicle posture detection model to obtain the detection result of the vehicle posture, wherein the detection result is used to determine the change information of the vehicle posture. The vehicle posture detection model determines the detection result based on clustering the feature vector, and the feature vector is determined based on the initial position image and the target position image.
[0112] Optionally, the detection module 302 is also used to: use the feature point pair extraction module to perform feature extraction on the initial position image and the target position image to obtain feature point pairs; use the feature vector extraction module to perform vector extraction on the feature point pairs to obtain feature vectors; use the feature vector clustering module to perform clustering operations on the feature vectors to obtain target feature vectors; determine the detection results based on the target feature vector and the initial position image.
[0113] Optionally, the vehicle posture detection device also includes an extraction module 303, which is used to: the acquisition module uses a preset image detection algorithm to extract feature points in the initial position image to obtain a first feature point; uses a preset image detection algorithm to extract feature points in the target position image to obtain a second feature point; uses a preset matching algorithm to match the first feature point and the second feature point to obtain a feature point pair.
[0114] Optionally, the vehicle posture detection device also includes a processing module 304, which is used to: construct a feature point pair vector based on the feature point pair; perform a normal operation on the feature point pair vector pair to obtain a normal feature vector; perform a gradient operation on the feature point pair vector to obtain a gradient feature vector.
[0115] Optionally, the acquisition module 301 is also used to obtain the initial cluster center and the distance information from the feature vector to the initial cluster center; the processing module 304 is also used to: assign feature vectors based on the distance information; update the cluster center based on the difference between the feature vector and the initial cluster center; in response to the cluster center satisfying a preset convergence condition, filter the target feature vector based on the cluster center.
[0116] Optionally, the vehicle posture detection device also includes a determination module 305, which is used to: establish an affine transformation equation using the target feature vector; solve the affine transformation equation to obtain an affine transformation matrix; and determine the detection result using the affine transformation matrix and the first feature point.
[0117] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.
[0118] According to one embodiment of the present invention, there is also provided an electronic device, comprising: a memory storing an executable program; and a processor for running the program, wherein the above-mentioned vehicle posture detection method is implemented when the program is running.
[0119] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:
[0120] Step S1, obtaining an initial position image and a target position image of the vehicle;
[0121] Step S2, using the vehicle posture detection model to detect the initial position image and the target position image to obtain the detection result of the vehicle posture, wherein the detection result is used to determine the change information of the vehicle posture, and the vehicle posture detection model determines the detection result based on clustering the feature vector, and the feature vector is determined based on the initial position image and the target position image.
[0122] According to one embodiment of the present invention, a computer-readable storage medium is also provided, the computer-readable storage medium including a stored executable program, wherein when the executable program is running, the device where the storage medium is located is controlled to execute the above-mentioned vehicle posture detection method.
[0123] Optionally, in this embodiment, the storage medium may be configured to store a computer program for performing the following steps:
[0124] Step S1, obtaining an initial position image and a target position image of the vehicle;
[0125] Step S2, using the vehicle posture detection model to detect the initial position image and the target position image to obtain the detection result of the vehicle posture, wherein the detection result is used to determine the change information of the vehicle posture, and the vehicle posture detection model determines the detection result based on clustering the feature vector, and the feature vector is determined based on the initial position image and the target position image.
[0126] Optionally, in this embodiment, the above-mentioned storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store computer programs.
[0127] According to one embodiment of the present invention, a computer program product is also provided, including a computer program, and the computer program implements the above-mentioned vehicle posture detection method when executed by a processor.
[0128] Optionally, in this embodiment, the computer program product may be configured as a computer program for executing the following steps:
[0129] Step S1, obtaining an initial position image and a target position image of the vehicle;
[0130] Step S2, using the vehicle posture detection model to detect the initial position image and the target position image to obtain the detection result of the vehicle posture, wherein the detection result is used to determine the change information of the vehicle posture, and the vehicle posture detection model determines the detection result based on clustering the feature vector, and the feature vector is determined based on the initial position image and the target position image.
[0131] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be described in detail here.
[0132] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0133] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0134] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0135] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0136] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0137] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk, etc. Various media that can store program codes.
[0138] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A vehicle posture detection method, characterized in that: include: Acquire an initial position image and a target position image of the target vehicle; The initial position image and the target position image are detected using a vehicle posture detection model to obtain a detection result of the vehicle posture, wherein the detection result is used to determine change information of the vehicle posture, and the vehicle posture detection model determines the detection result based on a clustering result of a feature vector, and the feature vector is determined based on the initial position image and the target position image.
2. The vehicle posture detection method according to claim 1, characterized in that: The vehicle posture detection model comprises a feature point pair extraction module, a feature vector extraction module and a feature vector clustering module. The vehicle posture detection model is used to detect the initial position image and the target position image, and the vehicle posture detection result obtained includes: Using the feature point pair extraction module to extract features from the initial position image and the target position image to obtain feature point pairs; Using the feature vector extraction module to extract vectors from the feature point pairs to obtain the feature vectors; Using the feature vector clustering module to perform a clustering operation on the feature vector to obtain a target feature vector; The detection result is determined based on the target feature vector and the initial position image.
3. The vehicle posture detection method according to claim 2, characterized in that: The feature point pair extraction module is used to extract features from the initial position image and the target position image to obtain feature point pairs including: Extract feature points in the initial position image using a preset image detection algorithm to obtain first feature points; Extracting feature points in the target position image using the preset image detection algorithm to obtain second feature points; The first feature point and the second feature point are matched using a preset matching algorithm to obtain the feature point pair.
4. The vehicle posture detection method according to claim 2, characterized in that: The feature vector includes a paradigm feature vector and a gradient feature vector. The feature vector extraction module is used to extract vectors from the feature point pairs to obtain the feature vectors including: Constructing a feature point pair vector according to the feature point pair; Performing a normal form operation on the feature point vector pair to obtain the normal form feature vector; A gradient operation is performed on the feature point vector to obtain the gradient feature vector.
5. The vehicle posture detection method according to claim 2, characterized in that: The feature vector clustering module is used to perform a clustering operation on the feature vector to obtain a target feature vector including: Obtaining the initial cluster center and the distance information from the feature vector to the initial cluster center; assigning the feature vector based on the distance information; Updating the cluster center based on the difference between the feature vector and the initial cluster center; In response to the cluster center satisfying a preset convergence condition, the target feature vector is screened based on the cluster center.
6. The vehicle posture detection method according to claim 3, characterized in that: Determining the detection result based on the target feature vector and the initial position image includes: Establishing an affine transformation equation using the target feature vector; Solving the affine transformation equation to obtain an affine transformation matrix; The detection result is determined using the affine transformation matrix and the first feature point.
7. A vehicle posture detection device, characterized in that: include: An acquisition module, used for acquiring an initial position image and a target position image of the vehicle; A detection module is used to detect the initial position image and the target position image using a vehicle posture detection model to obtain a detection result of the vehicle posture, wherein the detection result is used to determine the change information of the vehicle posture, and the vehicle posture detection model determines the detection result based on clustering feature vectors, and the feature vectors are determined based on the initial position image and the target position image.
8. An electronic device, characterized in that: include: A memory storing an executable program; A processor is used to run the program, wherein the vehicle posture detection method described in any one of claims 1 to 6 is executed when the program is run.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored executable program, wherein when the executable program is running, the device where the storage medium is located is controlled to execute the vehicle posture detection method according to any one of claims 1 to 6.
10. A computer program product, characterized in that It comprises a computer program, which, when executed by a processor, implements the vehicle posture detection method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Navigation image matching filtering method based on K-means clustering algorithm
CN106355197A
A hazardous chemical substance cargo feature point matching method and system
CN109816051A
UAV pose estimation method based on lightweight visual odometer
CN109871024A