Image generation method and device, model training method and device, equipment and storage medium
By establishing a three-dimensional ground model, drawing traffic markings and merging background images, and using a simulated four-way fisheye camera to generate inverse perspective images, the problem of difficult inverse perspective image acquisition is solved, and efficient and diversified inverse perspective image generation is achieved to meet the needs of Data requirements in autonomous driving and assisted driving.
Patent Information
- Application Number
- CN202411047393.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-01
- Publication Date
- 2024-08-30
- Estimated Expiration
- 2044-08-01
AI Technical Summary
It is difficult to collect inverse perspective transformation images, resulting in insufficient data volume. Especially with the demand for lane line detection in autonomous driving or assisted driving, the existing technology cannot meet the demand for large and diverse images.
By establishing a three-dimensional ground model of preset size, drawing traffic markings and merging background images, using a simulated four-way fisheye camera to generate four-way fisheye images, and then splicing them into inverse perspective images based on the inverse perspective fusion algorithm, generating a large number of diverse Inverse perspective picture.
It realizes the efficient generation of inverse perspective images, meets the needs of a large number of diverse inverse perspective images, solves the problem of insufficient data volume, reduces the cost of manual annotation, and improves the diversity and richness of images.
Smart Images

Figure CN118570409A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to an image generation method, a model training method, an apparatus, a device and a storage medium. Background Art
[0002] Inverse Perspective Mapping (IPM) refers to the angle transformation in order to eliminate the perspective effect of the image taken by the camera. For example, in autonomous driving or assisted driving, lane line detection is very important. In the image taken by the forward-looking camera, due to the existence of the perspective effect, objects that are originally parallel intersect in the image. The IPM transformation can be used to eliminate this perspective effect. The IPM image obtained by IPM is sometimes also called a "bird's-eye view". IPM images are difficult to collect and the collection cost is high, but in some cases, a large number of diverse IPM images are required. For example, a model that recognizes IPM images requires a large number of IPM images as training samples. Summary of the Invention
[0003] In view of this, the present invention provides an image generation method, a model training method, an apparatus, a device and a storage medium to solve the problem of insufficient data volume caused by the difficulty in collecting IPM images.
[0004] In a first aspect, the present invention provides an image generation method, the method comprising: Create a 3D ground model of preset size; Drawing traffic markings on the ground of the three-dimensional ground model, wherein the traffic markings are signs drawn on the ground, including parking space lines, lane lines, parking space signs and / or driving instruction signs; fusing a background image onto the three-dimensional ground model on which traffic markings have been drawn; Generate a four-way fisheye image based on the three-dimensional ground model integrated with the background image using a simulated four-way fisheye camera, wherein the simulated four-way fisheye camera is used to simulate four fisheye cameras on the front, back, left, and right sides of a vehicle; The four fisheye images are spliced into an inverse perspective image based on an inverse perspective fusion algorithm.
[0005] In an optional embodiment, drawing traffic markings on the ground of the three-dimensional ground model includes: Setting a parking space entrance center point in the ground plan of the three-dimensional ground model; A parking space line is drawn on the ground plan according to the set parking space rotation angle, parking space size, and the center point of the parking space entrance.
[0006] In an optional embodiment, drawing traffic markings on the ground of the three-dimensional ground model further includes: Determining, in the ground plan view, a first drawing area for the lane line and / or a second drawing area for the driving indication mark according to the center point of the parking space entrance; The center of the lane line is determined within the first drawing area, and the lane line is drawn according to the determined center of the lane line; and / or the center of the driving instruction sign is determined within the second drawing area, and the driving instruction sign is drawn within the second drawing area according to the determined center of the driving instruction sign.
[0007] In an optional embodiment, drawing traffic markings on the ground of the three-dimensional ground model further includes: Determining a drawing center point of the parking space marker according to the parking space entrance center point, the parking space size, and the parking space rotation angle; The parking space mark is drawn according to the drawing center point of the parking space mark.
[0008] In an optional embodiment, the generating of four fisheye images based on the three-dimensional ground model integrated with the background image using a simulated four-way fisheye camera includes: Get the distance between the set wheel stop bar and the parking space line; Determining a drawing center point of the wheel blocking rod according to the distance, the parking space size, and the parking space rotation angle; Obtain a three-dimensional wheel blocking rod model; Based on the drawing center point of the wheel blocking rod, the three-dimensional wheel blocking rod model is fused with the three-dimensional ground model fused with the background image to obtain a fused three-dimensional model; The four fisheye images are generated based on the three-dimensional model.
[0009] In a second aspect, the present invention provides a model training method, comprising: Obtaining a reverse perspective image generated by the image generation method of the first aspect or any corresponding embodiment thereof, and obtaining drawing parameters and / or categories corresponding to traffic markings in the reverse perspective image; The model is trained by using the reverse perspective image as a training sample and the rendering parameters and / or categories as label values.
[0010] In a third aspect, the present invention provides an image generating device, comprising: A three-dimensional model building module is used to build a three-dimensional ground model of a preset size; a drawing module, configured to draw traffic markings on the ground surface of the three-dimensional ground model, wherein the traffic markings are marks drawn on the ground surface, including parking space lines, lane lines, parking space marks and / or driving instruction marks; A background fusion module, configured to fuse a background image onto the three-dimensional ground model on which traffic markings have been drawn; An image generation module is configured to generate a four-way fisheye image based on the three-dimensional ground model integrated with the background image using a simulated four-way fisheye camera, wherein the simulated four-way fisheye camera is configured to simulate four fisheye cameras on the front, back, left, and right sides of a vehicle; The splicing module is used to splice the four fisheye images into an inverse perspective image based on an inverse perspective fusion algorithm.
[0011] In a fourth aspect, the present invention provides a model training device, comprising: an acquisition module, configured to acquire an inverse perspective image generated by the image generation method of the first aspect or any corresponding embodiment thereof, and to acquire drawing parameters and / or categories corresponding to traffic markings in the inverse perspective image; The model training module is used to train the model by using the reverse perspective image as a training sample and the rendering parameters and / or categories as label values.
[0012] In a fifth aspect, the present invention provides a computer device comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, computer instructions being stored in the memory, and the processor executing the image generation method of the first aspect or any corresponding embodiment thereof or the model training method of the second aspect by executing the computer instructions.
[0013] In a sixth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the image generation method of the first aspect or any corresponding embodiment thereof, or to execute the model training method of the second aspect.
[0014] In a seventh aspect, the present invention provides a computer program product comprising computer instructions, the computer instructions being used to enable a computer to execute the image generation method of the first aspect or any corresponding embodiment thereof, or to execute the model training method of the second aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the specific embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0016] Figure 1 is a flowchart of an image generating method according to an embodiment of the present invention; Figure 2 is a schematic diagram of drawing multiple parking space lines based on multiple parking space entrance center points according to an embodiment of the present invention; Figure 3 is a schematic diagram of the center of a driving indication mark determined within a drivable area after the parking space lines are drawn according to an embodiment of the present invention; Figure 4 This is a schematic diagram of drawing a driving indication mark in a drivable area after drawing parking space lines according to an embodiment of the present invention; Figure 5 is a schematic diagram of a parking space number drawing center point determined after parking space lines are drawn according to an embodiment of the present invention; Figure 6 is a schematic diagram of drawing a parking space usage mark in a parking space after drawing a parking space line according to an embodiment of the present invention; Figure 7 is a schematic diagram of fusing a background image after drawing parking space lines and traffic markings according to an embodiment of the present invention; Figure 8 is a schematic diagram of a three-dimensional ground model fused with a three-dimensional wheel blocking rod model and projected onto the ground according to an embodiment of the present invention; Figure 9 is one of the schematic diagrams for generating four-way fisheye images according to an embodiment of the present invention; Figure 10 This is a second schematic diagram of generating four fisheye images according to an embodiment of the present invention; Figure 11 This is a third schematic diagram of generating four fisheye images according to an embodiment of the present invention; Figure 12 This is a fourth schematic diagram of generating four fisheye images according to an embodiment of the present invention; Figure 13 According to an embodiment of the present invention, Figures 9-12 Schematic diagram of an inverse perspective image obtained by stitching four fisheye images shown; Figure 14 is a structural block diagram of an image generating apparatus according to an embodiment of the present invention; Figure 15is a structural block diagram of a model training device according to an embodiment of the present invention; Figure 16 Schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0017] To make the purpose, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are 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 those skilled in the art without making creative efforts shall fall within the scope of protection of the present invention.
[0018] The embodiment of the present invention provides an image generation method, which can generate a large number of reverse perspective pictures to meet the demand for a large number of diverse reverse perspective pictures.
[0019] According to an embodiment of the present invention, an embodiment of an image generation 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 executable computer 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.
[0020] In this embodiment, an image generation method is provided, which can be used in computer devices such as terminals and servers. Figure 1 is a flow chart of an image generating method according to an embodiment of the present invention. Figure 1 As shown, the process includes the following steps: Step S101: Create a three-dimensional ground model of a preset size.
[0021] For example, the 3D ground model can be a 30m x 30m 3D simulation model. Building on the 3D wireframe model, the 3D ground model adds information about faces, surface features, and edge connection directions, achieving a surface-based definition and description of the 3D surface. This model can meet the needs of applications such as face-to-face intersection, line-to-face elimination, and light and shade color mapping. Specifically, the 3D ground model defines the surface of a shape using a domain enclosed by directed edges, defining the shape as a collection of faces.
[0022] Step S102 : drawing traffic markings on the ground of the three-dimensional ground model. Traffic markings are signs drawn on the ground, including parking space lines, lane lines, parking space signs and / or driving instruction signs.
[0023] In an embodiment of the present invention, when drawing traffic markings on the ground of a three-dimensional ground model, the model ground needs to be converted into a plane image according to a scale, that is, a ground plane map, and then the traffic markings are drawn according to pixel size.
[0024] For example, if the pixel size is pixel = 1.875cm, converting the size of plane = 30mx30m into pixels will give the image resolution resolution(1600,1600).
[0025] Parking space lines are the lines that define the parking space and are generally enclosed rectangles, parallelograms, or two parallel lines connected by a short line at each end. Parking space markings include the space number and its intended use (e.g., disabled parking, family parking, or special parking). Driving signs include directional arrows (also known as driving direction arrows), such as arrows indicating straight ahead, left turn arrows, right turn arrows, and U-turns.
[0026] Each time a reverse perspective image is generated, only a portion of the aforementioned traffic markings can be drawn, or all of them can be drawn. Furthermore, the specific shape and position of the same traffic marking can be different each time an image is generated, thereby increasing the diversity of the generated images.
[0027] The following will explain in detail how to draw traffic markings on the ground of a three-dimensional ground model with examples, which will not be described in detail here.
[0028] Step S103: fusing the background image onto the three-dimensional ground model on which the traffic markings have been drawn.
[0029] Step S104 , using a simulated four-way fisheye camera to generate four-way fisheye images based on the three-dimensional ground model that has been fused with the background image, where the simulated four-way fisheye camera is used to simulate the four-way fisheye cameras on the front, back, left, and right sides of the vehicle.
[0030] A simulated fisheye camera calculates a fisheye image based on given camera intrinsics and extrinsic parameters and a field of view. These camera intrinsics and extrinsic parameters and field of view can be the same as those used for an actual fisheye camera. Different camera intrinsics and extrinsic parameters and / or field of view result in different fisheye images. Therefore, you can generate different fisheye images by adjusting the simulated fisheye camera's intrinsics and extrinsic parameters and / or field of view.
[0031] Step S105: The four fisheye images are stitched together into an inverse perspective image based on an inverse perspective fusion algorithm. Specifically, the four fisheye images can be converted into inverse perspective images using an inverse perspective algorithm before being stitched together. During this conversion process, an inverse perspective calculation formula can be used. For details, please refer to the relevant art. The image generation method provided in this embodiment can generate a large number of various inverse perspective images, meeting the requirements for rich and diverse inverse perspective images.
[0032] The following describes in detail how to draw traffic markings on the ground of a three-dimensional ground model with examples.
[0033] In some optional specific implementations, step S102, i.e., drawing traffic markings on the ground of the three-dimensional ground model, includes: Step S1021, setting a parking space entrance center point (also referred to as a parking space entrance line center or parking space entrance line center point) in the ground plan of the three-dimensional ground model; Specifically, a coordinate system can be established for a three-dimensional ground model, in which the x-axis and y-axis planes are on the ground, that is, the x-axis and y-axis planes are on the ground plan, the x-axis is on the right of the coordinate system, the y-axis is in front, and the z-axis is above. The coordinate center point can be set at the center of the ground. According to the needs of image generation, the parking space entrance center point is set on the x-axis and y-axis planes. Only one parking space entrance center point can be set or multiple parking space entrance center points can be set. If only one is set, then one or more parking space entrance center points can be determined based on the parking space entrance center point and according to the parking space size. If multiple parking space entrance center points are set, the distance between the parking space entrance center points must also meet the parking space size restrictions.
[0034] Step S1022: Draw a parking space line on the ground plan according to the set parking space rotation angle, parking space size, and parking space entrance center point.
[0035] There are two types of parking spaces: rectangular parking spaces and oblique parking spaces (the shape of the parking space is a parallelogram). The rotation angle of the rectangular parking space is 90 degrees, while the rotation angle of the oblique parking space is an acute angle. The length of the parking space (the long side dimension) is recorded as , width (short side dimension) is recorded as , in meters. When drawing parking space lines on a ground plan, the parking space size needs to be converted into pixel counts based on the image resolution. The coordinates of the center point of the parking space entrance are , the parking space rotation angle is , then the four vertices of the parking space are 、 、 、 The parking space line drawn based on the four vertices is as follows Figure 2 Of course, the four vertices of the parking space can also be 、 、 、 , or 、 、 、 , or 、 、 、 .
[0036] Specifically, after calculating the coordinates of the four vertices of the parking space, the coordinate values need to be converted into pixel coordinate values, and then the parking space line is drawn on the ground plan.
[0037] Figure 2 The figure shows an example of drawing multiple parking space lines based on the center points of multiple parking space entrances. Figure 2 The coordinates of the four vertices of the vertical parking space are 、 、 、 . Figure 2 The coordinates of the four vertices of the middle and side parking spaces are 、 、 、 .
[0038] In the embodiment of the present invention, the traffic markings related to parking spaces are drawn on the ground of the three-dimensional ground model. In other optional embodiments, traffic markings related to lanes can also be drawn.
[0039] In some optional specific implementations, step S102, i.e., drawing traffic markings on the ground of the three-dimensional ground model, further includes: Step S1023: determining a first drawing area for lane lines and / or a second drawing area for driving instructions in the ground plan according to the center point of the parking space entrance; Step S1024: Determine the center of the lane line in the first drawing area and draw the lane line based on the determined center of the lane line; and / or determine the center of the driving instruction sign in the second drawing area and draw the driving instruction sign in the second drawing area based on the determined center of the driving instruction sign.
[0040] In the embodiment of the present invention, after the parking space lines are drawn, lane lines and / or driving instructions (guiding arrows) may be added within the drivable area based on the center point of the parking space entrance.
[0041] Specifically, when drawing the driving sign, the center point of the parking space entrance and the set effective range (for example, the effective range is within 10m of the center range) can be used to determine the second drawing area, and then the center position coordinates of the driving sign can be randomly generated in the second drawing area. , the center position coordinates The pixel coordinate value converted to the image is , The origin of the physical coordinate system established for the 3D ground model is at the center of the ground, while the origin of the image coordinate system is at the upper left corner of the image. resolution[0] is the number of pixels on the x-axis of the image, and resolution[1] is the number of pixels on the y-axis of the image.
[0042] Figure 3 The figure shows an example of the center of the driving sign determined within the drivable area after the parking space lines are drawn.
[0043] Figure 4 The figure shows an example of drawing a driving indication sign in the drivable area after the parking space lines are drawn.
[0044] In some other optional specific implementations, step S102, i.e., drawing traffic markings on the ground of the three-dimensional ground model, further includes: Step S1025, determining the drawing center point of the parking space sign based on the parking space entrance center point, parking space size and parking space rotation angle; the parking space sign includes the parking space number and / or parking space use sign, and the parking space use sign can be, for example, a family parking space sign, a disabled parking space sign, etc. Step S1026: Draw the parking space mark according to the drawing center point of the parking space mark.
[0045] Specifically, the drawing center point of the parking space mark, for example, the drawing center point of the parking space number can coincide with the center point of the parking space entrance (e.g. Figure 5 The center point of the parking space number in the vertical parking space is drawn), so the coordinates of the center point of the parking space number are , , convert the coordinate value into pixel coordinate value , The center point of the parking space number can also be drawn outside the parking space entrance, such as Figure 5 The center point of the parking space number for a medium-sloped parking space is just outside the parking space entrance. Of course, the center point of the parking space number can also be inside the parking space.
[0046] Figure 5 The red dot in the figure is the center point of the parking space number.
[0047] In addition, the center point of the parking space marking, such as the center point of the parking space use marking, may also be at a certain distance from the center point of the parking space entrance. For example, the horizontal distance between the center point of the parking space use marking and the center point of the parking space entrance is For rectangular side and vertical parking spaces, the coordinates of the center point of the parking space marking are: ; or, .
[0048] for Figure 2-4 For the inclined parking space shown, the coordinates of the center point of the parking space sign are: ; or, ; or, ; or, .
[0049] Convert the coordinate value of the center point of the parking space mark to pixel coordinate value , .
[0050] Figure 6 The figure shows an example of drawing a parking space use mark in a parking space after the parking space line is drawn.
[0051] In other optional specific implementations, instead of first determining the center point of the parking space sign, a corner point of the parking space sign may be determined, and then the parking space sign is drawn based on the corner point.
[0052] Figure 7 The figure shows the background image after the parking space lines and traffic markings (parking space numbers, arrows, and disabled parking space signs) are drawn.
[0053] In some optional specific implementations, step S104, i.e., using a simulated four-way fisheye camera to generate four-way fisheye images based on the three-dimensional ground model fused with the background image, includes: Step S1041 , obtaining a distance between a set wheel stopper and a parking space line; for example, the parking space line is generally a parking space line close to the front position or the rear position of the vehicle.
[0054] Step S1042, determining the drawing center point of the wheel blocking rod according to the distance, parking space size and parking space rotation angle; Specifically, if the horizontal distance between the wheel stop and the parking space line (the parking space line at the rear of the vehicle) is set to rear_distance=1m, for a rectangular vertical parking space, the coordinates of the center point of the wheel stop are: ; or, ; For a rectangular side parking space, the coordinates of the center point of the wheel stop are: ; or, ; or, ; or, ; for Figure 2-4 For the inclined parking space shown, the coordinates of the center point of the wheel stop are: ; or, ; or, ; or, ; Convert the coordinate value of the center point of the wheel stop rod above into pixel coordinate value , .
[0055] Step S1043, obtaining a three-dimensional wheel blocking rod model; Step S1044, based on the drawing center point of the wheel stopper, fusing the three-dimensional wheel stopper model with the three-dimensional ground model that has been fused with the background image to obtain a fused three-dimensional model; Figure 8 The figure shows an example of a 3D ground model fused with a 3D wheel stopper model and projected onto the ground (the background is not shown in the figure).
[0056] Step S1045 : Generate four fisheye images based on the three-dimensional model.
[0057] Specifically, the simulated four-way fisheye camera used to generate the four-way fisheye image can be implemented based on carlas-sim. Figure 9 、 Figure 10 、 Figure 11 and Figure 12 , respectively simulating the images captured by the fisheye camera in front of the car, the images captured by the fisheye camera on the left side of the car, the images captured by the fisheye camera behind the car, and the images captured by the fisheye camera on the right side of the car.
[0058] Based on the inverse perspective fusion algorithm Figures 9-12 The reverse perspective image obtained by stitching the four fisheye images shown is as follows Figure 13 shown.
[0059] An embodiment of the present invention provides a model training method, comprising: Step 1: Obtain the reverse perspective image generated by the above-mentioned image generation method embodiment, and obtain the drawing parameters and / or categories corresponding to the traffic markings in the reverse perspective image; Specifically, drawing parameters can include size, coordinate position, and parking space number. The category can be a traffic marking category, such as parking space lines, lane lines, parking space signs, and driving signs. The category can be a directional arrow category, such as a straight arrow, a left turn arrow, a right turn arrow, or a U-turn arrow. The category can be a lane marking category, such as a solid line or a dashed line. The category can also be a parking space sign category, such as family parking spaces, disabled parking spaces, and dedicated parking spaces.
[0060] Drawing parameters and / or categories are obtained according to the needs of model training annotation, that is, whatever annotation values are needed during model training are obtained.
[0061] Step 2: Use the reverse perspective image as a training sample and the drawing parameters and / or categories as annotation values to train a model. The model can be a traffic marking recognition model, a positioning model, etc.
[0062] In this embodiment of the present invention, the aforementioned image generation method is used to generate the inverse perspective images required for model training, resolving the issue of insufficient inverse perspective images due to the difficulty in obtaining them, which in turn leads to insufficient model training samples. Furthermore, the relevant parameters used during image generation can be directly used as annotation values, saving manual annotation costs and ensuring high annotation accuracy.
[0063] This embodiment also provides an image generation device for implementing the above-mentioned image generation method embodiment and preferred implementation. Details already described will not be repeated here. As used below, the term "module" may refer to a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation using hardware, or a combination of software and hardware, is also possible and contemplated.
[0064] This embodiment provides an image generating device, such as Figure 14 As shown, including: A three-dimensional model building module 1101 is used to build a three-dimensional ground model of a preset size; A drawing module 1102 is configured to draw traffic markings on the ground surface of the three-dimensional ground model. The traffic markings are markings drawn on the ground surface, including parking space lines, lane lines, parking space markings, and / or driving indication markings. A background fusion module 1103 is used to fuse the background image onto the three-dimensional ground model on which the traffic markings are drawn; An image generation module 1104 is configured to generate a four-way fisheye image based on the three-dimensional ground model integrated with the background image using a simulated four-way fisheye camera, wherein the simulated four-way fisheye camera is configured to simulate four fisheye cameras on the front, back, left, and right sides of a vehicle; The stitching module 1105 is configured to stitch the four fisheye images into an inverse perspective image based on an inverse perspective fusion algorithm.
[0065] In some optional implementations, the drawing module 1102 includes: a parking space entrance center point setting unit, configured to set a parking space entrance center point in the ground plan of the three-dimensional ground model; The first drawing unit is configured to draw a parking space line on the ground plan according to a set parking space rotation angle, parking space size, and a center point of the parking space entrance.
[0066] In some optional implementations, the drawing module 1102 further includes: a first determining unit, configured to determine, in the ground plan view, a first drawing area for the lane line and / or a second drawing area for the driving indication mark according to the center point of the parking space entrance; The second drawing unit is configured to determine the center of the lane line within the first drawing area and draw the lane line based on the determined center of the lane line; and / or determine the center of the driving instruction sign within the second drawing area and draw the driving instruction sign within the second drawing area based on the determined center of the driving instruction sign.
[0067] In some optional implementations, the drawing module 1102 further includes: A second determining unit is configured to determine a drawing center point of the parking space marker according to the parking space entrance center point, the parking space size, and the parking space rotation angle; The third drawing unit is configured to draw the parking space mark according to a drawing center point of the parking space mark.
[0068] In some optional implementations, the image generation module includes: A first obtaining unit is used to obtain a set distance between the wheel blocking rod and the parking space line; a third determining unit, configured to determine a drawing center point of the wheel blocking rod according to the distance, the parking space size, and the parking space rotation angle; A second acquisition unit is used to acquire a three-dimensional wheel blocking rod model; a fusion unit, configured to fuse the three-dimensional wheel blocking rod model with the three-dimensional ground model fused with the background image based on a drawing center point of the wheel blocking rod, to obtain a fused three-dimensional model; A generating unit is configured to generate the four fisheye images based on the three-dimensional model.
[0069] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0070] The image generating device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0071] In this embodiment, a model training device is also provided, which is used to implement the above-mentioned model training method embodiment and preferred implementation mode, which have been described and will not be repeated here. As used below, the term "module" can implement a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceived.
[0072] The embodiment of the present invention provides a model training device, please refer to Figure 15 ,include: An acquisition module 1201 is configured to acquire the reverse perspective image generated by the above-mentioned embodiment of the image generation method, and to acquire drawing parameters and / or categories corresponding to traffic markings in the reverse perspective image; The model training module 1202 is configured to train the model by using the reverse perspective image as a training sample and the rendering parameters and / or categories as label values.
[0073] The model training device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0074] The embodiment of the present invention also provides a computer device having the above Figure 14 The image generating device shown or the above Figure 15 The model training device shown.
[0075] See also Figure 16 , Figure 16 is a structural diagram of a computer device provided by an optional embodiment of the present invention, such as Figure 16As shown, the computer device includes: one or more processors 10, memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components utilize different buses to communicate with each other and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in the memory or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Equally, multiple computer devices can be connected, and each device provides part of the necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 16 A processor 10 is taken as an example.
[0076] The processor 10 may be a central processing unit, a network processor, or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit, a programmable logic device, or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic, or any combination thereof.
[0077] The memory 20 stores instructions that can be executed by at least one processor 10, so as to enable at least one processor 10 to execute the method shown in the above embodiment.
[0078] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and application programs required for at least one function; the data storage area may store data created based on the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely located relative to the processor 10, and these remote memories may be connected to the computer device 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.
[0079] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid-state drive; the memory 20 may also include a combination of the above types of memory.
[0080] The computer device further includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30 and the output device 40 may be connected via a bus or other means. Figure 16 The bus connection is taken as an example.
[0081] The input device 30 can receive input digital or character information and generate key signal input related to user settings and function control of the computer device. Examples include a touch screen, keypad, mouse, trackpad, touchpad, pointing stick, one or more mouse buttons, trackball, joystick, etc. The output device 40 may include a display device, auxiliary lighting devices (e.g., LEDs), and tactile feedback devices (e.g., vibration motors). Such display devices include, but are not limited to, liquid crystal displays, light emitting diodes, monitors, and plasma displays. In some optional embodiments, the display device may be a touch screen.
[0082] The computer device further includes a communication interface for the computer device to communicate with other devices or a communication network.
[0083] The embodiment of the present invention also provides a computer-readable storage medium. The above-mentioned method according to the embodiment of the present invention can be implemented in hardware, firmware, or implemented as a computer code that can be recorded in a storage medium, or implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and downloaded through a network and will be stored in a local storage medium, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state drive, etc.; further, the storage medium can also include a combination of the above-mentioned types of memory. It can be understood that a computer, a processor, a microprocessor controller or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor or hardware, the method shown in the above embodiment is implemented.
[0084] A portion of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the form in which the computer program instruction exists in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc. Accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium that can be accessed by the computer.
[0085] Although the embodiments of the present invention have been described with reference to the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention. Such modifications and variations are all within the scope defined by the appended claims.
Claims
1. An image generation method, characterized in that: The method comprises: Create a three-dimensional ground model of preset size; Drawing traffic markings on the ground of the three-dimensional ground model, wherein the traffic markings are marks drawn on the ground, including parking space lines, lane lines, parking space marks and / or driving instruction marks; fusing a background image onto the three-dimensional ground model on which traffic markings have been drawn; Using a simulated four-way fisheye camera to generate a four-way fisheye picture based on the three-dimensional ground model that has been fused with the background image, the simulated four-way fisheye camera is used to simulate the four-way fisheye cameras on the front, back, left and right sides of the vehicle; The four fisheye images are spliced into an inverse perspective image based on an inverse perspective fusion algorithm.
2. The method according to claim 1, characterized in that Drawing traffic markings on the ground of the three-dimensional ground model includes: Setting a parking space entrance center point in the ground plan of the three-dimensional ground model; A parking space line is drawn on the ground plan according to the set parking space rotation angle, parking space size, and the center point of the parking space entrance.
3. The method according to claim 2, characterized in that The method of drawing traffic markings on the ground of the three-dimensional ground model further includes: Determine, in the ground plan view, a first drawing area for the lane line and / or a second drawing area for the driving indication mark according to the center point of the parking space entrance; Determine the center of the lane line in the first drawing area, and draw the lane line according to the determined center of the lane line; and / or determine the center of the driving instruction sign in the second drawing area, and draw the driving instruction sign in the second drawing area according to the determined center of the driving instruction sign.
4. The method according to claim 2, characterized in that: The method of drawing traffic markings on the ground of the three-dimensional ground model further includes: Determining a drawing center point of the parking space mark according to the parking space entrance center point, the parking space size and the parking space rotation angle; The parking space mark is drawn according to the drawing center point of the parking space mark.
5. The method according to claim 1, characterized in that The method of using a simulated four-way fisheye camera to generate a four-way fisheye picture based on the three-dimensional ground model integrated with the background image comprises: Get the distance between the set wheel stopper and the parking space line; Determining the drawing center point of the wheel blocking rod according to the distance, parking space size and parking space rotation angle; Obtain a three-dimensional wheel blocking rod model; Based on the drawing center point of the wheel blocking rod, the three-dimensional wheel blocking rod model is fused with the three-dimensional ground model that has been fused with the background image to obtain a fused three-dimensional model; The four-way fisheye image is generated based on the three-dimensional model.
6. A model training method, characterized in that: include: Obtaining a reverse perspective image generated by the image generation method according to any one of claims 1 to 5, and obtaining drawing parameters and / or categories corresponding to traffic markings in the reverse perspective image; The reverse perspective image is used as a training sample, and the drawing parameters and / or categories are used as label values to train the model.
7. An image generating device, characterized in that: The device comprises: A three-dimensional model building module is used to build a three-dimensional ground model of a preset size; A drawing module, used for drawing traffic markings on the ground of the three-dimensional ground model, wherein the traffic markings are marks drawn on the ground, including parking space lines, lane lines, parking space marks and / or driving instruction marks; A background fusion module, used for fusing the background image onto the three-dimensional ground model on which the traffic markings have been drawn; A picture generation module, used to generate a four-way fisheye picture based on the three-dimensional ground model integrated with the background image using a simulated four-way fisheye camera, wherein the simulated four-way fisheye camera is used to simulate four-way fisheye cameras on the front, back, left and right sides of the vehicle; The splicing module is used to splice the four fisheye images into an inverse perspective image based on an inverse perspective fusion algorithm.
8. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the image generation method according to any one of claims 1 to 5 or the model training method according to claim 6 by executing the computer instructions.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the image generation method described in any one of claims 1 to 5 or the model training method described in claim 6.
10. A computer program product, characterized in that It includes computer instructions, and the computer instructions are used to enable a computer to execute the image generation method described in any one of claims 1 to 5 or the model training method described in claim 6.
Citation Information
Patent Citations
Car roof panoramic camera based on laser radar and calibration method thereof
CN112233188A
Vehicle end real-time parking space detection method and device
CN114140429A
Three-dimensional vehicle tracking method and device based on monocular vision and electronic equipment
CN116403191A
Fisheye image sample generation method and device, computer equipment and storage medium
CN117011474A
Mobile mapping method and device for parking lot scene
CN117055067A
