Disclosure of Invention
The present application is directed to solving the above problems and providing a method for detecting obstacles in a formula car, a corresponding apparatus, an electronic device, and a computer-readable storage medium.
In order to meet the purposes of the application, the application adopts the following technical scheme:
One of the objects of the present application is to provide a method for detecting an obstacle in a formula car, comprising:
responding to the obstacle detection instruction of the equation motorcycle race to obtain a track field Jing Tuxiang in a monocular camera of the equation motorcycle race;
Performing target detection on the track scene image based on a pre-trained cone detection model, and determining two-dimensional frames of cones of various colors in the track scene image;
Based on a two-dimensional frame of the cone barrel, assuming a three-dimensional frame of the cone barrel, constructing a projection combination related to the three-dimensional frame and the two-dimensional frame, and based on projection point pairs in the projection combination, constructing an overdetermined equation set of related pixel coordinates and three-dimensional coordinates of the cone barrel, solving the overdetermined equation set by adopting a least square method, and determining the three-dimensional position coordinates of the cone barrel in a camera coordinate system;
And determining the distance between the cone barrels of each color type and the formula car based on the three-dimensional position coordinates, and indicating the formula car to adjust the driving direction according to the distance so as to finish the detection of the obstacle of the formula car.
Optionally, the step of training the cone detection model includes:
Acquiring a single training sample and a supervision label thereof in a training set, inputting the training sample into a preset cone detection model, and extracting image characteristic information of an area corresponding to coordinates marked by a corresponding supervision label in a track scene image of the training sample;
the image characteristic information is classified and mapped to preset classification spaces corresponding to the position information and the color types of a plurality of cone barrels, the classification probability corresponding to each classification space is obtained, the position information and the color types of the cone barrels represented by the classification space with the largest classification probability are determined,
Calculating the position information of the cone represented by the classification space with the maximum classification probability and the loss value corresponding to the color type of the cone based on the position information of the cone and the color type of the cone marked by the supervision label by adopting a loss function,
And when the loss values of the various items reach a preset threshold value, indicating that the cone detection model is trained to a convergence state so as to complete training of the cone detection model.
Optionally, the step of constructing a projection combination of the three-dimensional frame and the two-dimensional frame based on the two-dimensional frame of the cone and assuming the three-dimensional frame of the cone, and constructing an overdetermined equation set of the associated pixel coordinates and the three-dimensional coordinates of the cone based on the projection point pairs in the projection combination includes:
taking the central point of the three-dimensional frame of the cone barrel in the three-dimensional space as the origin of a world coordinate system, and determining eight corner points of the three-dimensional frame of the cone barrel under the world coordinate system;
And projecting eight corner points of the three-dimensional frame of the cone under the world coordinate system into a camera coordinate system to construct a projection combination of the three-dimensional frame and the two-dimensional frame, and constructing an overdetermined equation set of the associated pixel coordinate and the three-dimensional coordinate of the cone based on projection point pairs in the projection combination.
Optionally, the step of solving the overdetermined equation set by using a least square method to determine the three-dimensional position coordinates of the cone in the camera coordinate system includes:
Solving the overdetermined equation set according to a plurality of projection combinations of the three-dimensional frame and the two-dimensional frame by adopting a least square method;
And projecting the center of the three-dimensional frame of the cone barrel obtained by each projection combination onto a two-dimensional image to determine a projection point, comparing the projection point with the center point of the two-dimensional frame of the cone barrel, and selecting a solution corresponding to the projection combination with the minimum pixel distance between the two points as the three-dimensional position coordinate of the cone barrel.
Optionally, the cone of each color class includes one or more of a red cone, a blue cone and a yellow cone;
the red cone represents an obstacle on the left side of the unmanned aerial vehicle racing track, the blue cone represents an obstacle on the right side of the unmanned aerial vehicle racing track, and the yellow cone represents a starting point or an ending point of the unmanned aerial vehicle racing track.
Optionally, determining the distance between the cone barrels of each color class and the formula car based on the three-dimensional position coordinates, and indicating the formula car to adjust the driving direction according to the distance, including:
determining three-dimensional position coordinates of the cone barrels of all color types relative to the monocular camera, and determining the distances of the cone barrels of all color types relative to the formula car according to the three-dimensional position coordinates;
and detecting whether the distance is smaller than a preset collision distance, and if so, indicating the formula car to adjust the running direction based on the cone barrels with different colors so as to avoid collision of the formula car.
Optionally, the basic network architecture of the cone detection model is YoloV model.
Another object of the present application is to provide an obstacle detection device for a formula car, comprising:
the track image acquisition module is used for responding to the obstacle detection instruction of the equation motorcycle race and acquiring a track field Jing Tuxiang in a monocular camera of the equation motorcycle race;
The cone barrel two-dimensional frame determining module is used for carrying out target detection on the track scene image based on a pre-trained cone barrel detection model and determining the two-dimensional frames of cone barrels of various colors in the track scene image;
The overdetermined equation set determining module is arranged to construct a projection combination of the three-dimensional frame and the two-dimensional frame based on the assumption of the three-dimensional frame of the cone barrel based on the two-dimensional frame of the cone barrel, and construct an overdetermined equation set of the associated pixel coordinates and the three-dimensional coordinates of the cone barrel based on the projection point pairs in the projection combination;
The three-dimensional coordinate determining module is used for solving the overdetermined equation set by adopting a least square method and determining the three-dimensional position coordinate of the cone barrel in a camera coordinate system;
And the obstacle detection module is used for determining the distance between the cone barrels of each color type and the formula car based on the three-dimensional position coordinates, and indicating the formula car to adjust the driving direction according to the distance so as to finish the detection of the obstacle of the formula car.
An electronic device adapted for another object of the present application comprises a central processor and a memory, said central processor being adapted to invoke the steps of running a computer program stored in said memory for performing the method for detecting obstacles in formula car according to the application.
A computer readable storage medium adapted to another object of the present application stores a computer program implemented according to the method for detecting obstacles in equation (a) for car of the unmanned aerial vehicle in the form of computer readable instructions, which when invoked by a computer, performs the steps included in the corresponding method.
Compared with the prior art, the application aims at the problems that in the prior art, for cone detection on an unmanned equation track, the two-dimensional detection accuracy of the cone is low, the three-dimensional detection accuracy is reduced, the three-dimensional position of the cone is obtained by multi-line laser radar or information fusion of a camera and a radar, the hardware cost is high, and the like, and the application comprises the following beneficial effects:
According to the application, by acquiring monocular camera information and cone priori size information, firstly acquiring image coordinates of a cone two-dimensional frame, then carrying out conversion of a space coordinate system according to the assumption of the two-dimensional frame as a three-dimensional frame, and finally establishing a three-dimensional space coordinate system to solve the cone position. Under the condition of strong priori, the application realizes the monocular three-dimensional target detection of the cone barrel, and has the characteristics of low hardware cost, high accuracy and stable identification;
furthermore, the method for detecting the obstacle of the equation motorcycle race can prevent the equation motorcycle race from impacting the obstacle of the cone in the race track by accurately and rapidly detecting the position and the color type of the obstacle of the cone of each color type, can greatly improve the reactivity of the equation motorcycle race to avoid the obstacle of the cone of each color type, so as to remarkably improve the running speed of the equation motorcycle race, ensure the rapid and orderly running of the equation motorcycle race, and greatly improve the race score of the equation motorcycle race.
Detailed Description
Embodiments of the present application are described in detail below, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to like or similar elements or elements having like or similar functions throughout. The embodiments described below by referring to the drawings are illustrative only and are not to be construed as limiting the application.
As used herein, the singular forms "a", "an", "the" and "the" are intended to include the plural forms as well, unless expressly stated otherwise, as understood by those skilled in the art. It will be further understood that the terms "comprises" and/or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof. It will be understood that when an element is referred to as being "connected" or "coupled" to another element, it can be directly connected or coupled to the other element or intervening elements may also be present. Further, "connected" or "coupled" as used herein may include wirelessly connected or wirelessly coupled. The term "and/or" as used herein includes all or any element and all combination of one or more of the associated listed items.
It will be understood by those skilled in the art that all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs unless defined otherwise. It will be further understood that terms, such as those defined in commonly used dictionaries, should be interpreted as having a meaning that is consistent with their meaning in the context of the prior art and will not be interpreted in an idealized or overly formal sense unless expressly so defined herein.
As used herein, "client," "terminal device," and "terminal device" are understood by those skilled in the art to include both devices that include only wireless signal receivers without transmitting capabilities and devices that include receiving and transmitting hardware capable of two-way communication over a two-way communication link. Such devices may include cellular or other communication devices such as Personal computers, tablet computers, cellular or other communication devices having a single-wire or multi-wire display or no multi-wire display, PCS (Personal Communications Service, personal communication system) which may combine voice, data processing, facsimile and/or data communication capabilities, PDA (Personal DIGITAL ASSISTANT ) which may include a radio frequency receiver, pager, internet/intranet access, web browser, notepad, calendar and/or GPS (Global Positioning System ) receiver, conventional laptop and/or palmtop computer or other device having and/or including a radio frequency receiver. As used herein, "client," "terminal device" may be portable, transportable, installed in a vehicle (aeronautical, maritime, and/or land-based), or adapted and/or configured to operate locally and/or in a distributed fashion, at any other location(s) on earth and/or in space. As used herein, a "client," "terminal device," or "terminal device" may also be a communication terminal, an internet terminal, or a music/video playing terminal, for example, may be a PDA, a MID (Mobile INTERNET DEVICE ), and/or a Mobile phone with a music/video playing function, or may also be a device such as a smart tv, a set top box, or the like.
The application refers to hardware such as a server, a client, a service node, and the like, which essentially is an electronic device with personal computer and other functions, and is a hardware device with necessary components disclosed by von neumann principles such as a central processing unit (including an arithmetic unit and a controller), a memory, an input device, an output device, and the like, wherein a computer program is stored in the memory, and the central processing unit calls the program stored in the memory to run, executes instructions in the program, and interacts with the input and output devices, thereby completing specific functions.
It should be noted that the concept of the present application, called "server", is equally applicable to the case of server clusters. The servers should be logically partitioned, physically separate from each other but interface-callable, or integrated into a physical computer or group of computers, according to network deployment principles understood by those skilled in the art. Those skilled in the art will appreciate this variation and should not be construed as limiting the implementation of the network deployment approach of the present application.
One or more technical features of the present application, unless specified in the clear, may be deployed either on a server for implementation and the client remotely invokes an online service interface provided by the acquisition server for implementation of the access, or may be deployed and run directly on the client for implementation of the access.
The neural network model cited or possibly cited in the application can be deployed on a remote server and can be used for implementing remote call on a client, or can be deployed on a client with sufficient equipment capability for direct call, unless specified by plaintext, and in some embodiments, when the neural network model runs on the client, the corresponding intelligence can be obtained through migration learning so as to reduce the requirement on the running resources of the hardware of the client and avoid excessively occupying the running resources of the hardware of the client.
The various data related to the present application, unless specified in the plain text, may be stored either remotely in a server or in a local terminal device, as long as it is suitable for being invoked by the technical solution of the present application.
It will be appreciated by those skilled in the art that the various methods of the application, although described based on the same concepts as one another in common, may be performed independently of one another unless otherwise indicated. Similarly, for the various embodiments disclosed herein, all concepts described herein are presented based on the same general inventive concept, and thus, concepts described herein with respect to the same general inventive concept, and concepts that are merely convenient and appropriately modified, although different, should be interpreted as equivalents.
The various embodiments of the present application to be disclosed herein, unless the plain text indicates a mutually exclusive relationship with each other, the technical features related to the various embodiments may be cross-combined to flexibly construct a new embodiment as long as such combination does not depart from the inventive spirit of the present application and can satisfy the needs in the art or solve the deficiencies in the prior art. This variant will be known to the person skilled in the art.
In recent years, with the development of mathematics, sensor technology and computer hardware technology. In this context, the chinese automobile engineering society and 2017 began to hold chinese college student universities (FSAC). As a key technology in unmanned, the accuracy, the real-time performance and the accuracy of the target detection have important influence on the overall stability of the subsequent unmanned system. The FSAC racing track is mainly formed by enclosing a cone-shaped cone barrel, wherein the left side of the racing track is provided with a red cone barrel, and the right side of the racing track is provided with a blue cone barrel. There are also large yellow cones and small yellow cones at the starting and stopping positions of the racing car.
Referring to fig. 1, referring to the above exemplary scenario, in one embodiment, the method for detecting an obstacle in a formula car of the present application includes:
Step S10, responding to an obstacle detection instruction of the equation motorcycle race to obtain a track field Jing Tuxiang in a monocular camera of the equation motorcycle race;
The terminal device of the equation motorcycle race can respond to the equation motorcycle race obstacle detection instruction to obtain a track field Jing Tuxiang in a monocular camera of the equation motorcycle race, wherein the track scene image comprises a road, various color types of cones and the like, each color type of cone comprises one or more of a red cone, a blue cone and a yellow cone, the red cone represents an obstacle on the left side of the equation motorcycle race, the blue cone represents an obstacle on the right side of the equation motorcycle race, and the yellow cone represents a starting point or an ending point of the equation motorcycle race.
In some embodiments, after the track scene image in the monocular camera of the formula car is obtained, the track scene image can be subjected to data enhancement, noise addition, part deletion, rotation, clipping and translation operations are performed on the track scene image to perform data enhancement, so that the accuracy and the robustness of the cone barrel detection model in target detection on the track scene image are improved, and the data-enhanced image adopts a semi-automatic labeling mode, so that the data labeling efficiency can be greatly improved.
In some embodiments, samples are processed by randomly selecting at least one data enhancement method such as noise adding, part deleting, rotation, cutting and translation operation, ten samples are expanded for each sample in the original data set to obtain 4410 new samples, and finally 4410 marked sample pictures are obtained through semi-automatic marking, so that the semi-automatic tool marking effect is poor. According to the ratio of 7:3, 3528 pieces are randomly divided to serve as training sets and 882 pieces serve as verification sets, after data enhancement is adopted, training data quantity can be increased, generalization capability of a model is improved, noise data is increased, robustness of a two-dimensional detection model is improved, and a more accurate two-dimensional detection frame is provided for three-dimensional target detection.
Step S20, performing target detection on the track scene image based on a pre-trained cone detection model, and determining two-dimensional frames of cones of various colors in the track scene image;
After a track scene image in a monocular camera of the equation motorcycle race is acquired, performing target detection on the track scene image based on a pre-trained cone detection model, and determining two-dimensional frames of cones of various colors such as a red cone, a blue cone and a yellow cone in the track scene image.
Training the cone detection model, comprising the following steps:
Step S201, acquiring a single training sample and a supervision label thereof in a training set, inputting the training sample into a preset cone detection model, and extracting image characteristic information of an area corresponding to coordinates marked by a corresponding supervision label in a track scene image of the training sample;
step 203, mapping the image feature information to preset classification spaces corresponding to the position information and the color types of the plurality of cone barrels in a classification manner, obtaining classification probabilities corresponding to the classification spaces in a mapping manner, and determining the position information and the color types of the cone barrels represented by the classification space with the largest classification probability;
step S205, calculating the position information of the cone represented by the classification space with the maximum classification probability and a loss value corresponding to the color type of the cone based on the position information of the cone and the color type of the cone marked by the supervision label by adopting a loss function;
And S207, when the loss values of the various items reach a preset threshold value, indicating that the cone detection model is trained to a convergence state, so as to complete training of the cone detection model.
Specifically, the basic network architecture of the cone detection model may be YoloV models, etc., the cone detection model may be pre-acquired with the stage scene images of cones with various color types as training samples, the stage scene images may originate from historical video frames or images in unmanned equation events, etc., the stage scene images are labeled with their supervision labels correspondingly for various training samples, the position information of the cones in the stage scene images of the training samples and the color types of the cones are labeled, on the basis of completing the labeling of various training samples, the various training samples and their supervision labels may be mapped to form training sets, the single training sample in the training set and their supervision labels are acquired, the training samples are input into the preset cone detection model, the image feature information of the region corresponding to the coordinates labeled by the corresponding supervision labels in the stage scene images of the training samples is extracted, the image feature information is classified and mapped to the position information of the cone with the preset characteristic, the cone types are mapped to the space corresponding to obtain the probability corresponding to the classification space, the largest classification probability of the cone is determined, the cone position information with the largest classification probability is mapped to the cone types, the cone type is calculated based on the position information of the cone type of the cone, the cone is calculated based on the state information of the cone type is the largest, the color loss is calculated when the color loss is calculated by the cone type model is calculated based on the state information of the cone detection model, and the color loss is calculated by the cone type model is calculated, the model can be subjected to gradient update according to various loss values, the model is further approximately converged by reversely propagating and correcting weight parameters of various links of the model, then iterative training is carried out on the model by continuously calling the next training sample in the training set until the model is trained to a converged state, and it is easy to understand that the cone barrel detection model after training until convergence can detect the position information and the color types of the cone barrel in the current track scene image in a game picture, and the two-dimensional frame of the cone barrel of each color type in the track scene image is determined.
Step S30, a projection combination of the three-dimensional frame and the two-dimensional frame is constructed based on the assumption of the three-dimensional frame of the cone barrel, an overdetermined equation set of associated pixel coordinates and three-dimensional coordinates of the cone barrel is constructed based on projection point pairs in the projection combination, and a least square method is adopted to solve the overdetermined equation set, so that three-dimensional position coordinates of the cone barrel in a camera coordinate system are determined;
After two-dimensional frames of cone barrels of various colors such as a red cone barrel, a blue cone barrel and a yellow cone barrel in the racetrack scene image are determined, assuming the three-dimensional frames of the cone barrels based on the two-dimensional frames of the cone barrels of various colors such as the red cone barrel, the blue cone barrel and the yellow cone barrel, constructing a projection combination related to the three-dimensional frames and the two-dimensional frames, and constructing an overdetermined equation set related to pixel coordinates and cone barrel three-dimensional coordinates based on projection point pairs in the projection combination;
a step of constructing a projection combination of the three-dimensional frame and the two-dimensional frame based on a two-dimensional frame of the cone, and constructing an overdetermined equation set of the associated pixel coordinates and the three-dimensional coordinates of the cone based on projection point pairs in the projection combination, wherein the step comprises the following steps:
Step S301, using the central point of the three-dimensional frame of the cone barrel in the three-dimensional space as the origin of a world coordinate system, and determining eight corner points of the three-dimensional frame of the cone barrel under the world coordinate system;
And step S303, projecting eight corner points of the three-dimensional frame of the cone under the world coordinate system into a camera coordinate system to construct a projection combination of the three-dimensional frame and the two-dimensional frame, and constructing an overdetermined equation set of the associated pixel coordinate and the three-dimensional coordinate of the cone based on projection point pairs in the projection combination.
Further, the step of solving the overdetermined equation set by using a least square method to determine the three-dimensional position coordinates of the cone barrel in a camera coordinate system comprises the following steps:
Step S3001, solving the overdetermined equation set according to a plurality of projection combinations of the three-dimensional frame and the two-dimensional frame by adopting a least square method;
Step S3003, projecting the center of the three-dimensional frame of the cone barrel obtained by each projection combination onto a two-dimensional image to determine a projection point, comparing the projection point with the center point of the two-dimensional frame of the cone barrel, and selecting a solution corresponding to the projection combination with the minimum pixel distance between the two points as the three-dimensional position coordinate of the cone barrel.
Specifically, based on the two-dimensional frames of the red cone, the blue cone, the yellow cone and other cone types, the three-dimensional frames of the cone are assumed, and a priori scene is combined, so that projection combinations of eight angular points and pixel coordinates of 64 three-dimensional frames can be constructed, in order to simplify calculation, the central point of the three-dimensional frames of the cone types of the red cone, the blue cone, the yellow cone and other cone types in the three-dimensional space is taken as the origin of a world coordinate system, meanwhile, the length and width of a target are taken as the directions of three coordinates of the world coordinate system, and the size of the priori target is taken as the length, the width and the height of the three-dimensional frames, wherein dx, dy and dz are the a priori width, the height and the length of the cone respectively, and the eight angular points of the cone types of the red cone, the blue cone, the yellow cone and other cone types in the world coordinate system are:
further, based on the projection point pairs in the projection combination, an overdetermined equation set of the associated pixel coordinates and the three-dimensional coordinates of the cone barrel is constructed, and the specific steps are as follows:
projected from the world coordinate system to the camera coordinate system:
in the formula (1), X c is the X coordinate under the camera coordinate system, X w is the X coordinate under the world coordinate system, and R 3×3、T3×1 is the rotation translation matrix respectively;
From camera coordinate system to pixel coordinate system:
In the formula (2), u and v represent pixel coordinates, dx and dy represent pixel sizes, f represents a focal length of the camera, and the combination of the formula (1) and the formula (2) can be expressed as follows:
K in the formula (3) is a camera internal reference matrix, and can be obtained by calibrating camera internal references.
The deformation can be performed by the formula (3) as follows:
r 3×3 and [ X w Yw Zw]T ] are used as known amounts, and all the known amounts are combined and replaced with a conversion matrix M to obtain the formula (5) shown below.
From equation (5), the coordinate Z c of a point in the Z direction under the camera coordinate system can be expressed as:
Substituting equation 6 into equation (5) above, equations (7) and (8) for pixel coordinates u, v, respectively, can be expressed as follows:
referring to fig. 2,3 and 4, based on the assumption of the three-dimensional frame of the cone, the projection combinations associated with the three-dimensional frame and the two-dimensional frame are constructed, 64 projection combinations can be constructed, each combination contains 4 projection point pairs, the 4 projection point pairs can extract four coordinate values u min,umax,vmin,vmax of the two-dimensional detection frame of the cone, as shown in fig. 2, the four coordinate values u min,umax,vmin,vmax of the two-dimensional detection frame of the cone are respectively substituted into the formula (7) and the formula (8) by pixel coordinate values (u max,vmax) of the upper left corner (u min,vmin) and the lower right corner of the two-dimensional frame, an overdetermined equation set (9) with the number of equations of 4 for unknowns can be constructed, and a translation matrix of T 3×1 (world coordinate system and camera coordinate system) can be obtained by a least square method. Because the world coordinate system is established on the three-dimensional center of the target, the solved T 3×1 is the x, y and z coordinate position of the camera relative to the target. Therefore, -T 3×1 is the three-dimensional position information of the target in the camera coordinate system, and the overdetermined equation set (9) is expressed as follows:
The 64 projection combinations are solved to obtain 64-T 3×1, the center of the target three-dimensional frame obtained by each combination is projected onto a two-dimensional image, the projection points are compared with the center point of the target two-dimensional frame obtained by the cone detection model, and the-T 3×1 corresponding to the projection combination with the minimum pixel distance between the two points is selected as the three-dimensional position coordinate of the target.
And S50, determining the distance between the cone barrels of each color type and the formula car based on the three-dimensional position coordinates, and indicating the formula car to adjust the driving direction according to the distance so as to finish the detection of the obstacle of the formula car.
After the three-dimensional position coordinates of the cone barrels in the camera coordinate system are determined, the distances of the cone barrels of all color types relative to the formula car are determined based on the three-dimensional position coordinates, and the formula car is instructed to adjust the driving direction according to the distances so as to finish detection of the obstacle of the formula car.
In some embodiments, determining the distance of the cone of each color category relative to the formula car based on the three-dimensional position coordinates, and indicating the formula car to adjust the driving direction according to the distance comprises:
Step S501, determining three-dimensional position coordinates of the cone barrels of all color types relative to the monocular camera, and determining the distances of the cone barrels of all color types relative to the formula car according to the three-dimensional position coordinates;
Step S503, detecting whether the distance is smaller than a preset collision distance, if so, indicating the formula car to adjust the driving direction based on the cones with different colors so as to avoid collision of the formula car.
Specifically, after three-dimensional position coordinates of red cone, blue cone, yellow cone and other cone types are determined, the red cone characterizes left obstacle of the equation track, the blue cone characterizes right obstacle of the equation track, the yellow cone characterizes start or end of the equation track, the three-dimensional position coordinates of red cone, blue cone, yellow cone and other cone types are used for determining distance between the cone of each color type and the equation car, detecting whether the distance between the cone of each color type and the equation car is smaller than a preset collision distance, if so, indicating that the equation car adjusts the driving direction based on the equation car of different colors, indicating that the equation car adjusts the driving direction leftwards when the cone is the blue cone, and indicating that the equation car can collide with the equation car rightwards when the cone is the red cone, and ensuring that the equation car can collide with the equation car rightwards when the cone is the red cone.
Compared with the prior art, the method and the device aim at the problems that in the prior art, for cone detection on an unmanned equation track, the two-dimensional detection accuracy of the cone is low, the three-dimensional detection accuracy is reduced, the three-dimensional position of the cone is obtained by multi-line laser radar or information fusion of a camera and a radar, the hardware cost is high, and the like, and the method and the device comprise the following advantages:
According to the application, by acquiring monocular camera information and cone priori size information, firstly acquiring image coordinates of a cone two-dimensional frame, then carrying out conversion of a space coordinate system according to the assumption of the two-dimensional frame as a three-dimensional frame, and finally establishing a three-dimensional space coordinate system to solve the cone position. Under the condition of strong priori, the application realizes the monocular three-dimensional target detection of the cone barrel, and has the characteristics of low hardware cost, high accuracy and stable identification;
furthermore, the method for detecting the obstacle of the equation motorcycle race can prevent the equation motorcycle race from impacting the obstacle of the cone in the race track by accurately and rapidly detecting the position and the color type of the obstacle of the cone of each color type, can greatly improve the reactivity of the equation motorcycle race to avoid the obstacle of the cone of each color type, so as to remarkably improve the running speed of the equation motorcycle race, ensure the rapid and orderly running of the equation motorcycle race, and greatly improve the race score of the equation motorcycle race.
Referring to fig. 5, an apparatus for detecting an obstacle in a formula car according to the present application includes a track image acquisition module 1100, a cone two-dimensional frame determination module 1200, an overdetermined equation set determination module 1300, a three-dimensional coordinate determination module 1400, and an obstacle detection module 1500. The system comprises a track image acquisition module 1100, a cone two-dimensional frame determination module 1200, an overdetermined equation set determination module 1300, a three-dimensional coordinate determination module 1400 and an obstacle detection module 1500, wherein the track image acquisition module 1100 is configured to respond to an obstacle detection instruction of an equation car for the unmanned aerial vehicle to acquire a track field Jing Tuxiang in a monocular camera of the equation car for the unmanned aerial vehicle, the cone two-dimensional frame determination module 1200 is configured to perform target detection on the track scene image based on a pretrained cone detection model to determine two-dimensional frames of cones of various colors in the track scene image, the overdetermined equation set determination module 1300 is configured to construct a projection combination of the three-dimensional frames and the two-dimensional frames based on the two-dimensional frames of the cones to construct an overdetermined equation set of associated pixel coordinates and cone three-dimensional coordinates based on projection point pairs in the projection combination, the three-dimensional coordinate determination module 1400 is configured to solve the overdetermined equation set by adopting a least square method to determine three-dimensional position coordinates of the cones in a camera coordinate system, and the obstacle detection module 1500 is configured to determine distances of cones of various colors relative to the equation cars of the equation car for the unmanned aerial vehicle based on the three-dimensional position coordinates to instruct the equation car to complete the detection of the unmanned aerial vehicle to detect the obstacle.
On the basis of any embodiment of the present application, referring to fig. 6, another embodiment of the present application further provides an electronic device, where the electronic device may be implemented by a computer device, and as shown in fig. 6, the internal structure of the computer device is schematically shown. The computer device includes a processor, a computer readable storage medium, a memory, and a network interface connected by a system bus. The computer readable storage medium of the computer device stores an operating system, a database and computer readable instructions, the database can store a control information sequence, and when the computer readable instructions are executed by the processor, the processor can realize the method for detecting the obstacle of the formula car. The processor of the computer device is used to provide computing and control capabilities, supporting the operation of the entire computer device. The memory of the computer device may have stored therein computer readable instructions that, when executed by the processor, cause the processor to perform the method of the present application for detecting a vehicle in which the equation motorcycle is a car obstacle. The network interface of the computer device is for communicating with a terminal connection. It will be appreciated by those skilled in the art that the structure shown in FIG. 6 is merely a block diagram of some of the structures associated with the present inventive arrangements and is not limiting of the computer device to which the present inventive arrangements may be applied, and that a particular computer device may include more or fewer components than shown, or may combine some of the components, or have a different arrangement of components.
The processor in this embodiment is configured to execute specific functions of each module and its sub-module in fig. 5, and the memory stores program codes and various data required for executing the above modules or sub-modules. The network interface is used for data transmission between the user terminal or the server. The memory in this embodiment stores program codes and data required for executing all modules/sub-modules in the device for detecting the obstacle in the formula car according to the present application, and the server can call the program codes and data of the server to execute the functions of all the sub-modules.
The present application also provides a storage medium storing computer readable instructions that, when executed by one or more processors, cause the one or more processors to perform the steps of the method for detecting an obstacle in formula car according to any one of the embodiments of the present application.
The present application also provides a computer program product comprising computer programs/instructions which when executed by one or more processors implement the steps of the method for detecting an obstacle in a formula car according to any one of the embodiments of the application.
Those skilled in the art will appreciate that all or part of the processes implementing the methods of the above embodiments of the present application may be implemented by a computer program for instructing relevant hardware, where the computer program may be stored on a computer readable storage medium, where the program, when executed, may include processes implementing the embodiments of the methods described above. The storage medium may be a computer readable storage medium such as a magnetic disk, an optical disk, a Read-Only Memory (ROM), or a random access Memory (Random Access Memory, RAM).
The foregoing is only a partial embodiment of the present application, and it should be noted that it will be apparent to those skilled in the art that modifications and adaptations can be made without departing from the principles of the present application, and such modifications and adaptations are intended to be comprehended within the scope of the present application.
In summary, according to the method for detecting the obstacle of the equation motorcycle race, the positions and the color types of the cone obstacles of each color type are accurately and rapidly detected, so that the equation motorcycle race can be prevented from impacting the cone obstacles in the race track, the reactivity of the equation motorcycle race for avoiding the cone obstacles of each color type can be greatly improved, the running speed of the equation motorcycle race is remarkably improved, the rapid and orderly running of the equation motorcycle race is ensured, and the race score of the equation motorcycle race is greatly improved.