Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but rather are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the disclosure are for illustration purposes only and are not intended to limit the scope of the disclosure.
It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order, and/or performed in parallel. Moreover, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
The term "include" and variations thereof as used herein are open-ended, i.e., "including but not limited to". The term "based on" is "based, at least in part, on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Relevant definitions for other terms will be given in the following description.
It should be noted that the terms "first", "second", and the like in the present disclosure are only used for distinguishing different devices, modules or units, and are not used for limiting the order or interdependence relationship of the functions performed by the devices, modules or units.
It is noted that references to "a", "an", and "the" modifications in this disclosure are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that "one or more" may be used unless the context clearly dictates otherwise.
The names of messages or information exchanged between devices in the embodiments of the present disclosure are for illustrative purposes only, and are not intended to limit the scope of the messages or information.
Fig. 1 is a flowchart of a method for generating a 3D target detection sample according to an embodiment of the present disclosure, where this embodiment is applicable to a case of generating a 3D target detection sample, and the method may be executed by a device for generating a 3D target detection sample, where the device may be composed of hardware and/or software, and may be generally integrated in a device having a function of generating a 3D target detection sample, where the device may be an electronic device such as a server, a mobile terminal, or a server cluster. As shown in fig. 1, the method specifically includes the following steps:
step 110, a 3D virtual model of the target object is obtained.
The 3D virtual model is an equal-scale (1:1) model of the target object, and may be drawn based on the real target object by using a cad (computer Aided drafting) technology, so that the 3D virtual model has characteristic information and appearance of the real target object, thereby ensuring that the 3D virtual model is close to the real target object. The target object may be any object to be subject to 3D target detection, for example: vehicles, human bodies, buildings, etc. In this embodiment, after the 3D virtual model of the target object is drawn based on the CAD technology, the 3D virtual model may be stored in the database, and the user may call it at will. After the 3D virtual model is obtained, the 3D virtual model is displayed on a current interface, and the displaying angle, the size and the like of the 3D virtual model can be adjusted at will.
And step 120, receiving camera shooting parameters and shooting mode information set by a user.
The camera may be understood as a virtual camera disposed in the system, and the camera shooting parameters may include a camera type, a focal length, an exposure level, and the like. The photographing mode information may include a single photographing mode, panning photographing information, and rotating photographing information. In this embodiment, buttons for selecting the camera shooting parameters and the shooting mode information by the user are displayed in the current application program interface, and the user clicks the buttons to realize the camera shooting parameters and the shooting mode information. The 3D target detection sample comprises a 3D target picture and labeling information.
Optionally, if the image is taken in a single-shot mode, the shooting mode information includes vehicle size, vehicle position information (represented by coordinates of a vehicle center point), vehicle orientation information, and the like, so that shooting is performed according to the camera shooting parameters and the shooting mode information, and a 3D target picture is obtained.
Optionally, the panning shooting information includes a first shooting height, a panning direction, a panning range, and a panning step length. Wherein, the first shooting height can be understood as the height of the camera from the vehicle; the direction of translation may include along the x-axis, along the y-axis, or along the Z-axis; the translation range can be determined according to the visual range of the current interface so as to prevent the 3D virtual model from translating out of the interface boundary; the panning step size may be determined according to the panning range and the set number of images.
Optionally, the rotation shooting information includes a second shooting height and a rotation step. Wherein the 3D virtual model rotates 360 degrees around the central point; the second shooting height may be understood as the height of the camera from the vehicle; the rotation step can be determined according to the number of the acquired images, and assuming that 10 images need to be acquired, the rotation step is 36 degrees.
Optionally, after receiving the camera shooting parameters and the shooting mode information set by the user, the method further includes the following steps: and receiving camera attitude information set by a user.
The camera attitude information includes a pitch angle, a rotation angle, and a deviation angle. For example, fig. 2 is an exemplary diagram of an interface for setting camera shooting parameters and shooting mode information of a 3D virtual model in this embodiment. As shown in fig. 2, taking a vehicle as an example, in the interface, the user can select a vehicle brand, set camera parameters, camera pose information, select a photographing method (a single picture, a translation picture, and a rotation picture), and store a path.
And step 130, generating a 3D target detection sample based on the camera shooting parameters and the shooting mode information.
And if the shooting mode is single shooting, generating a 3D target picture according to the camera shooting parameters and the shooting mode information of the single picture set by the user.
If the shooting mode is panning shooting, the process of generating the 3D target detection sample based on the camera shooting parameters and the shooting mode information may be: controlling the 3D virtual model to translate in a translation range according to a translation direction and a translation step length; and when the 3D virtual model translates to the current position, controlling the virtual camera to shoot the 3D virtual model at the first shooting height according to the camera shooting parameters to obtain a 3D target picture.
In this embodiment, each time the 3D virtual model is translated to a position, the virtual camera is controlled to shoot the 3D virtual model at the first shooting height according to the camera shooting parameters, so as to obtain a 3D target picture.
If the photographing mode is rotational photographing, a mode of generating the 3D object detection sample based on the camera photographing parameters and the photographing mode information may be: controlling the 3D virtual model to rotate according to the rotation step length; and when the 3D virtual model rotates to the current position, the virtual camera is controlled to shoot the 3D virtual model at the second shooting height according to the camera shooting parameters, and a 3D target picture is obtained.
In this embodiment, each time the 3D virtual model rotates to a position, the virtual camera is controlled to shoot the 3D virtual model at the second shooting height according to the camera shooting parameters, so as to obtain a 3D target picture.
And if the user sets the camera attitude information, shooting based on the camera shooting parameters, the shooting mode information and the camera attitude information to obtain a 3D target picture.
Optionally, generating a 3D target detection sample based on the camera shooting parameters and the shooting mode information further includes: determining vehicle orientation information according to the shooting mode information; generating annotation information of the 3D target picture based on the vehicle orientation information, the size information of the 3D virtual model, the position information and the camera pose information.
The size information of the 3D virtual model may include information such as length, width, and the like, and the position information may be represented by coordinates of a center point of the 3D virtual model. If the shooting mode is translational shooting, the orientation of the 3D virtual model in the acquired 3D target picture is the same as the initial orientation of the 3D virtual model. If the shooting mode is selective shooting, the orientation of the 3D virtual model in each 3D target map is determined by the initial orientation of the 3D virtual model and the rotating angle. If the target object is a vehicle, the labeling information includes vehicle size, vehicle center point position, vehicle direction, camera attitude information, and the like.
Optionally, the method further comprises the following steps: setting a storage path; and storing the 3D target picture and the labeling information into a storage path.
Exemplarily, fig. 3 is an exemplary diagram for storing a 3D target picture and annotation information in the present embodiment. As shown in fig. 3, the 3D target detection sample includes a 3D target picture and corresponding label information. The annotation information may be stored in the form of a text document (word format, PDF format, or TXT format).
After the 3D target picture and the corresponding labeling information are obtained, a detection frame of the 3D virtual model can be obtained, so that the 3D target detection sample basically labeled with the detection frame trains the target detection model. Illustratively, fig. 4 is an exemplary diagram of a 3D target detection sample labeled with a detection frame in the present embodiment. As shown in fig. 4, a detection frame generated according to the labeling information is marked around the vehicle.
According to the technical scheme of the embodiment of the disclosure, a 3D virtual model of a target object is obtained; the 3D virtual model is an equal-proportion model of the target object; receiving camera shooting parameters and shooting mode information set by a user; and generating a 3D target detection sample based on the camera shooting parameters and the shooting mode information. According to the method for generating the 3D target detection sample, the 3D target detection sample is generated based on the camera shooting parameters and the shooting mode information set by the user, the 3D object image in any posture can be acquired, the convenience of generating the 3D target detection sample is improved, and meanwhile the cost of generating the 3D target detection sample is reduced.
Fig. 5 is a schematic structural diagram of a generating apparatus for a 3D target detection sample according to an embodiment of the present disclosure. As shown in fig. 5, the apparatus includes:
a 3D virtual model obtaining module 210, configured to obtain a 3D virtual model of a target object; wherein the 3D virtual model is an equal-scale model of the target object;
a shooting mode information setting module 220, configured to receive camera shooting parameters and shooting mode information set by a user;
a 3D target detection sample generating module 230, configured to generate a 3D target detection sample based on the camera shooting parameters and the shooting mode information.
Optionally, the shooting mode information includes translation shooting information and rotation shooting information; the 3D target detection sample comprises a 3D target picture and labeling information.
Optionally, the panning shooting information includes a first shooting height, a panning direction, a panning range, and a panning step length; the 3D target detection sample generation module 230 is further configured to:
controlling the 3D virtual model to translate within the translation range according to the translation direction and the translation step length;
and when the 3D virtual model translates to the current position, controlling a virtual camera to shoot the 3D virtual model at the first shooting height according to the camera shooting parameters to obtain a 3D target picture.
Optionally, the rotation shooting information includes a second shooting height and a rotation step length; the 3D target detection sample generation module 230 is further configured to:
controlling the 3D virtual model to rotate according to the rotation step length;
and when the 3D virtual model rotates to the current position, controlling a virtual camera to shoot the 3D virtual model at the second shooting height according to the camera shooting parameters to obtain a 3D target picture.
Optionally, the method further includes: a camera pose information setting module to:
receiving camera attitude information set by a user; wherein the camera attitude information comprises a pitch angle, a rotation angle and a drift angle;
optionally, the 3D target detection sample generating module 230 is further configured to:
and generating a 3D target picture based on the camera shooting parameters, the shooting mode information and the camera posture information.
Optionally, the 3D target detection sample generating module 230 is further configured to:
determining vehicle orientation information according to the shooting mode information;
generating labeling information of the 3D target picture based on the vehicle orientation information, the size information, the position information and the camera pose information of the 3D virtual model.
Optionally, the method further includes: a storage path setting module to:
setting a storage path;
and storing the 3D target picture and the labeling information into the storage path.
The device can execute the methods provided by all the embodiments of the disclosure, and has corresponding functional modules and beneficial effects for executing the methods. For technical details that are not described in detail in this embodiment, reference may be made to the methods provided in all the foregoing embodiments of the disclosure.
Referring now to FIG. 6, a block diagram of an electronic device 300 suitable for use in implementing embodiments of the present disclosure is shown. The electronic device in the embodiments of the present disclosure may include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a vehicle terminal (e.g., a car navigation terminal), and the like, and a fixed terminal such as a digital TV, a desktop computer, and the like, or various forms of servers such as a stand-alone server or a server cluster. The electronic device shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 6, electronic device 300 may include a processing means (e.g., central processing unit, graphics processor, etc.) 301 that may perform various appropriate actions and processes in accordance with a program stored in a read-only memory device (ROM)302 or a program loaded from a storage device 305 into a random access memory device (RAM) 303. In the RAM 303, various programs and data necessary for the operation of the electronic apparatus 300 are also stored. The processing device 301, the ROM 302, and the RAM 303 are connected to each other via a bus 304. An input/output (I/O) interface 305 is also connected to bus 304.
Generally, the following devices may be connected to the I/O interface 305: input devices 306 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; an output device 307 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage devices 308 including, for example, magnetic tape, hard disk, etc.; and a communication device 309. The communication means 309 may allow the electronic device 300 to communicate wirelessly or by wire with other devices to exchange data. While fig. 6 illustrates an electronic device 300 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer-readable medium, the computer program containing program code for performing a method for recommending words. In such an embodiment, the computer program may be downloaded and installed from a network through the communication means 309, or installed from the storage means 305, or installed from the ROM 302. The computer program, when executed by the processing device 301, performs the above-described functions defined in the methods of the embodiments of the present disclosure.
It should be noted that the computer readable medium in the present disclosure can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
In some embodiments, the clients, servers may communicate using any currently known or future developed network Protocol, such as HTTP (HyperText Transfer Protocol), and may interconnect with any form or medium of digital data communication (e.g., a communications network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the Internet (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed network.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: acquiring a 3D virtual model of a target object; wherein the 3D virtual model is an equal-scale model of the target object; receiving camera shooting parameters and shooting mode information set by a user; and generating a 3D target detection sample based on the camera shooting parameters and the shooting mode information.
Computer program code for carrying out operations for the present disclosure may be written in any combination of one or more programming languages, including but not limited to an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present disclosure may be implemented by software or hardware. Where the name of an element does not in some cases constitute a limitation on the element itself.
The functions described herein above may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), systems on a chip (SOCs), Complex Programmable Logic Devices (CPLDs), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
According to one or more embodiments of the present disclosure, a method for generating a 3D target detection sample is disclosed, including:
acquiring a 3D virtual model of a target object; wherein the 3D virtual model is an equal-scale model of the target object;
receiving camera shooting parameters and shooting mode information set by a user;
and generating a 3D target detection sample based on the camera shooting parameters and the shooting mode information.
Further, the shooting mode information comprises translation shooting information and rotation shooting information; the 3D target detection sample comprises a 3D target picture and labeling information.
Further, the translation shooting information comprises a first shooting height, a translation direction, a translation range and a translation step length; generating a 3D target detection sample based on the camera shooting parameters and the shooting mode information, including:
controlling the 3D virtual model to translate within the translation range according to the translation direction and the translation step length;
and when the 3D virtual model translates to the current position, controlling a virtual camera to shoot the 3D virtual model at the first shooting height according to the camera shooting parameters to obtain a 3D target picture.
Further, the rotation shooting information comprises a second shooting height and a rotation step length; generating a 3D target detection sample based on the camera shooting parameters and the shooting mode information, including:
controlling the 3D virtual model to rotate according to the rotation step length;
and when the 3D virtual model rotates to the current position, controlling a virtual camera to shoot the 3D virtual model at the second shooting height according to the camera shooting parameters to obtain a 3D target picture.
Further, after receiving camera shooting parameters and shooting mode information set by a user, the method further comprises the following steps:
receiving camera attitude information set by a user; wherein the camera attitude information comprises a pitch angle, a rotation angle and a drift angle;
generating a 3D target detection sample based on the camera shooting parameters and the shooting mode information, including:
and generating a 3D target picture based on the camera shooting parameters, the shooting mode information and the camera posture information.
Further, generating a 3D target detection sample based on the camera shooting parameters and the shooting mode information includes:
determining vehicle orientation information according to the shooting mode information;
generating labeling information of the 3D target picture based on the vehicle orientation information, the size information, the position information and the camera pose information of the 3D virtual model.
Further, still include:
setting a storage path;
and storing the 3D target picture and the labeling information into the storage path.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present disclosure and the technical principles employed. Those skilled in the art will appreciate that the present disclosure is not limited to the particular embodiments described herein, and that various obvious changes, adaptations, and substitutions are possible, without departing from the scope of the present disclosure. Therefore, although the present disclosure has been described in greater detail with reference to the above embodiments, the present disclosure is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present disclosure, the scope of which is determined by the scope of the appended claims.