A method for parking space data expansion

By extracting parking lines and background images from real-world parking space images, generating foreground and background databases, and using deep learning algorithms to generate a set of target parking spaces, the problem of collecting real-world parking space databases is solved, improving parking space recognition efficiency and scene coverage.

CN116246124BActive Publication Date: 2026-02-24FORYOU GENERAL ELECTRONICS
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211665703.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-23
Publication Date
2026-02-24
Estimated Expiration
2042-12-23

AI Technical Summary

Technical Problem

Existing real-scene parking space databases rely on real-scene photography, which is difficult to acquire, costly to collect, and has low scene coverage, making it impossible for deep learning parking space recognition to cover various application scenarios.

Method used

By extracting parking line images and background images from real-world parking space images, importing them into foreground and background databases respectively, and using deep learning algorithms to generate reference parking lines, a set of target parking spaces is generated according to a preset distribution pattern. Combined with background image fusion, the number of simulated real-world parking spaces is expanded.

Benefits of technology

It reduced the difficulty and cost of data acquisition, improved scene coverage, enhanced image recognition efficiency, and achieved a more realistic simulation of parking space scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116246124B_ABST
    Figure CN116246124B_ABST
Patent Text Reader

Abstract

The application relates to the field of automobile electronics and provides a parking space data expansion method, which is based on the scene requirement of a deep learning algorithm in an image recognition technology, extracts a parking space line image from a collected real scene parking space image to generate a foreground database, extracts a parking space background image except the parking space line to generate a background database, and through separation and combination of the parking space line and the background image, the number of simulated real scene parking spaces can be effectively expanded; wherein, a reference parking space line is generated by acquiring a parking space line feature of any parking space line image, a target parking space set is generated according to the reference parking space line and a preset distribution rule, further, the number of simulated real scene parking spaces is expanded by forming parking space images with different preset distribution rules, so that the data acquisition difficulty and the acquisition cost are reduced, the scene coverage rate is improved, and the image recognition efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of automotive electronics technology, and more particularly to a method for expanding parking space data. Background Technology

[0002] Traditional image processing methods for parking space identification have low recognition rates, while deep learning methods achieve high recognition rates. However, deep learning requires a large number of different scenarios. Due to the complexity and diversity of parking space shapes, widths, line colors, and the degree of damage to lines, as well as the different road surfaces and weather conditions, real-world parking spaces are extremely complex. Therefore, the amount of data required to cover all types of parking spaces is too large. Without strong financial support, it will be impossible to collect enough parking space data, thus failing to cover various application scenarios. Summary of the Invention

[0003] This invention provides a method for expanding parking space data, which solves the technical problems of existing real-scene parking space databases, which rely on real-scene shooting for data acquisition, resulting in high data acquisition difficulty, high acquisition cost, and low scene coverage.

[0004] To address the above technical problems, this invention provides a method for expanding parking space data, comprising the following steps:

[0005] S1. Collect different real-world parking space images;

[0006] S2. Identify each of the real-world parking space images, extract the parking space line image and the parking space background image other than the parking space line, and import them into the foreground database and background database respectively.

[0007] S3. Obtain and identify any of the parking line images from the foreground database, obtain parking line features and generate reference parking lines, and generate a target parking space set according to the reference parking lines and a preset distribution pattern.

[0008] S4. Fuse each target parking space in the target parking space set with any parking space background image in the background database to obtain a simulated real-world parking space set.

[0009] This basic solution is based on the scenario requirements of deep learning algorithms in image recognition technology. It extracts parking line images from the acquired real-world parking space images to generate a foreground database and parking space background images other than parking lines to generate a background database. By separating and combining parking line and background images, the number of simulated real-world parking spaces can be effectively expanded. In addition, reference parking lines are generated by obtaining the parking line features of any of the parking line images. A target parking space set is generated according to the reference parking lines and a preset distribution pattern. Furthermore, the number of simulated real-world parking spaces is expanded by forming parking space images with different preset distribution patterns, thereby reducing the difficulty and cost of data acquisition, improving scene coverage, and thus improving image recognition efficiency.

[0010] In a further implementation, step S2 specifically involves: using a preset algorithm to extract parking line images and parking space background images (excluding parking lines) from the real-world parking space images, and importing the parking line images and parking space background images into the corresponding areas of the foreground database and background database according to classification criteria for storage.

[0011] The classification criteria include different weather conditions, indoor / outdoor conditions, vehicle type, road surface, and parking line color.

[0012] The preset algorithm includes clustering methods or region growing methods.

[0013] This solution generates a database based on actual collected real-world parking space images, and separates and combines real environmental data to make the generated parking space scene more realistic.

[0014] In a further implementation, step S3, generating the target parking space set according to the reference parking space lines and the preset distribution pattern, includes the following steps:

[0015] S31. Traverse the preset distribution patterns to obtain the target distribution pattern;

[0016] S32. Obtain the reference parking space line and the parking space width range;

[0017] S33. Based on the parking space type in the target distribution pattern, call the corresponding threshold adjustment strategy to set the space threshold;

[0018] S34. Based on the spatial threshold and the reference parking space line and parking space width range, call the parking space planning strategy to generate each side of the combined parking space image, determine whether the combined parking space image is complete, if yes, merge each side of the combined parking space image and proceed to the next step, if no, return to step S32.

[0019] S35. Control the combined parking space image to rotate around its own image center by a preset rotation angle, and obtain the coordinate data of each target parking space after rotation to generate a target parking space set.

[0020] The preset distribution pattern includes a first distribution pattern, a second distribution pattern, and a third distribution pattern. The corresponding combined parking space image includes single-sided combined parking spaces, opposite-sided combined parking spaces, and adjacent-sided combined parking spaces. The single-sided combined parking space includes single-sided parking spaces. The opposite-sided combined parking spaces include sequential single-sided parking spaces and opposite-sided parking spaces. The adjacent-sided combined parking spaces include sequential single-sided parking spaces and adjacent-sided parking spaces.

[0021] Based on the distribution patterns of parking spaces in real-world parking environments, this solution sets up a first, second, and third distribution pattern corresponding to single-sided combination parking spaces, opposite-sided combination parking spaces, and adjacent-sided combination parking spaces. These multiple distribution patterns multiply the number of original parking space images. At the same time, the parking spaces in the combination parking spaces are divided according to single-sided, opposite-sided, and adjacent-sided, making the parking space planning more systematic and facilitating subsequent target parking space planning, coordinate calculation, and combination parking space fusion.

[0022] In a further implementation, when the parking space type is a single-sided parking space or a cross-sided parking space, the threshold adjustment strategy includes:

[0023] A1. Determine if the target parking space is an angled parking space. If not, proceed directly to step S34. If yes, proceed to the next step.

[0024] A2. Then, based on the tilt angle of the inclined parking space and the reference parking space line, a spatial threshold is set, specifically as follows:

[0025] If the angled parking space is angled upwards, then calculate the space threshold on the side furthest from the angled parking space:

[0026] ;

[0027] If the angled direction of the angled parking space is downward, then calculate the spatial threshold of the angled parking space on the tilt side;

[0028] ;

[0029] in, , The initial value is a preset threshold. The length of the reference parking space line is α, and the tilt angle of the slanted parking space is α.

[0030] In a further implementation, when the parking space type is an adjacent parking space, the threshold adjustment strategy includes:

[0031] B1. Determine if the target parking space is an angled parking space. If not, proceed directly to step S34. If yes, proceed to the next step.

[0032] B2. Obtain the parking space planning data of the single-sided parking spaces corresponding to the current target distribution pattern, and obtain the maximum value of the expanded parking spaces on the horizontal and vertical coordinates from the parking space planning data;

[0033] B3. Then, based on the tilt angle of the inclined parking space and the reference parking line, a spatial threshold is set, specifically as follows:

[0034] When the diagonal direction of the adjacent parking space is to the left, calculate the spatial threshold of the diagonal parking space on the side furthest away and proceed to step B4:

[0035] ;

[0036] When the adjacent parking space is angled to the right, calculate the spatial threshold of the angled parking space on the tilted side and proceed to step B4;

[0037] ;

[0038] B4. Determine whether the vertical free space on the adjacent side meets the parking space planning requirements. If not, keep the original space threshold unchanged. If yes, proceed to the next step.

[0039] B5. When the diagonal direction of a single-sided parking space is downward and the diagonal direction of the adjacent parking space is left, calculate the space threshold of the diagonal parking space furthest from the side:

[0040] ;

[0041] When the diagonal direction of a single-sided parking space is downward and the diagonal direction of an adjacent parking space is to the right, then calculate the spatial threshold of the diagonal parking space on the side furthest from it:

[0042] .

[0043] Where n is the preset passage gap, Let l be the x-coordinate of the maximum value on the x and y coordinates, l be the length of the reference parking space line, and α be the tilt angle of the slanted parking space.

[0044] In a further implementation scheme, the parking space planning requirement is that the remaining vacant space is greater than or equal to the sum of the preset passage gap and the vertical length of the parking space, that is:

[0045]

[0046] Where n is the preset passage gap, The vertical coordinate is the maximum value on the horizontal and vertical coordinates, l is the length of the reference parking space line, α is the tilt angle of the slanted parking space, and h is the width or height of the combined parking space image.

[0047] Based on the difference between angled parking spaces and rectangular parking spaces, this solution specifically classifies and calculates the spatial threshold in the planning of angled parking spaces. It further refines and categorizes the spaces according to their angled direction and the distribution location of the target parking spaces, thereby covering both angled and rectangular parking space distribution scenarios, and ensuring that the parking space data in the scenarios is authentic and reasonable.

[0048] In a further implementation, the parking space planning strategy includes:

[0049] C1. Randomly select a target parking space width from the range of parking space widths, and obtain a preset number of parking spaces;

[0050] C2. Calculate the maximum number of parking spaces on any side of the image template based on the spatial threshold and the target parking space width, and determine the number of parking spaces to be generated based on the preset number of parking spaces and the parking space number threshold.

[0051] C3. Determine the starting position of the target parking space in the image template, determine the ending position of the target parking space according to the width of the target parking space, generate the target parking space in the image template according to the starting position and the ending position, and store the corresponding coordinate data;

[0052] C4. Update the number of parking spaces to be generated and determine if it is 0. If it is, proceed to step C6; otherwise, calculate the remaining available spaces.

[0053] C5. Determine whether the remaining vacant space is less than the minimum value of the parking space width range. If yes, proceed to step C6; otherwise, return to step C3.

[0054] C6. Is the target parking space generated by the current side an angled parking space? If not, proceed to step C7. If yes, perform an affine transformation on the target parking space according to the shape of the reference parking space line and record its coordinate data.

[0055] C7. Integrate the coordinate data of each target parking space.

[0056] This solution randomly selects parking space widths within a range to obtain the target parking space width, thus covering parking space scenarios with different widths. By randomly setting the number of preset parking spaces according to user intent and combining them with the starting position of the randomly selected target parking space, it can further achieve coverage of parking space scenarios with different numbers of parking spaces and different distribution areas, thereby further expanding the number of simulated real-world parking spaces.

[0057] In a further embodiment, in step C6, performing an affine transformation on the target parking space based on the shape of the reference parking space line includes:

[0058] a. Determine if the shape of the reference parking space line is "T". If not, proceed to the next step. If yes, perform an affine transformation on the target parking space and apply a smooth transition. Specifically, taking an example where the origin is on the left side of the image template, if... The processing formula is as follows:

[0059]

[0060]

[0061] Otherwise, if Then proceed to step b;

[0062] b. Perform an affine transformation and translation on the target parking space. The translation process is as follows:

[0063]

[0064]

[0065] in, It is a slanted directional sign. A value of 1 indicates that the parking space on the left is angled downwards. -1 indicates that the left parking space is angled upwards. Here are the coordinates of the "T"-shaped intersection, and (x, y) are the coordinate data from step D3.

[0066] This solution takes into account the characteristics of angled parking spaces. Based on the uniqueness of the "T" parking space line, two sets of affine transformation processing formulas are set to smooth the target parking space, thereby making the transition of the parking space line of the target parking space in the simulated real-world parking space more natural and the image clearer.

[0067] In a further implementation, in step S32, obtaining the parking space width range includes: obtaining the default maximum parking space width and minimum parking space width; if the target parking space is an angled parking space, then updating the maximum parking space width and minimum parking space width according to the angle of inclination, specifically:

[0068]

[0069] in, Maximum parking space width α is the minimum parking space width, and α is the tilt angle of the angled parking space.

[0070] This solution takes into account the diversity of parking space widths in the display, and sets a maximum parking space width and a minimum parking space width to form a range of parking space widths, thereby covering parking space scenarios with different widths.

[0071] In a further implementation, taking a single-sided parking space as an example (e.g., a left-side parking space), each side of the parking space in the fused combined parking space image includes:

[0072] When the preset distribution pattern is the first distribution pattern, draw a single-sided parking space in the image template according to the coordinate data and the reference parking space line;

[0073] When the preset distribution pattern is the second distribution pattern, the single-sided parking space will be drawn in the image template according to the coordinate data of the single-sided parking space and the reference parking space line, and then the coordinate data of the opposite-sided parking space after horizontal flipping will be obtained to draw the opposite-sided parking space.

[0074] When the preset distribution pattern is the third distribution pattern, the single-sided parking space will be drawn in the image template according to the coordinate data of the single-sided parking space and the reference parking space line, and then the coordinate data of the adjacent parking space after being flipped 90° to the right will be obtained to draw the adjacent parking space.

[0075] When creating combined parking space images, this solution first plans the parking spaces in the form of single-sided parking spaces, and then, based on different distribution patterns, flips the image to obtain the coordinate data of the corresponding opposite or adjacent parking spaces. This can further reduce the difficulty of parking space planning and improve the efficiency of parking space planning. Attached Figure Description

[0076] Figure 1 This is a flowchart of a parking space data expansion method provided by an embodiment of the present invention;

[0077] Figure 2 This is a schematic diagram of the spatial threshold planning provided in an embodiment of the present invention;

[0078] Figure 3 This is a mind map for constructing the target parking space set provided in an embodiment of the present invention;

[0079] Figure 4 This is a schematic diagram of a "T"-shaped parking space line provided in an embodiment of the present invention;

[0080] Figure 5 This is a classification diagram of the foreground database and background database provided in an embodiment of the present invention;

[0081] Figure 6 This is a schematic diagram of a combined parking space provided in an embodiment of the present invention. Detailed Implementation

[0082] The embodiments of the present invention are described in detail below with reference to the accompanying drawings. The embodiments are given for illustrative purposes only and should not be construed as limiting the present invention. The accompanying drawings are for reference and illustration only and do not constitute a limitation on the scope of patent protection of the present invention, because many changes can be made to the present invention without departing from the spirit and scope of the present invention.

[0083] This invention provides a method for expanding parking space data, such as... Figure 1 As shown, in this embodiment, steps S1 to S4 are included:

[0084] S1. Collect different real-world parking space images;

[0085] S2. Identify each real-scene parking space image, extract the parking space line image and the parking space background image other than the parking space line, and import them into the foreground database and background database respectively. Specifically, use a preset algorithm to extract the parking space line image and the parking space background image other than the parking space line from the real-scene parking space image, and import the parking space line image and the parking space background image into the corresponding areas of the foreground database and background database according to the classification criteria.

[0086] The classification criteria include different weather conditions, indoor / outdoor environments, vehicle types, road surfaces, and parking line colors. Based on shape, parking spaces are currently mainly categorized as I-shaped, T-shaped, and U-shaped, with T-shaped spaces further divided into closed and open T-shaped spaces. Specifically, a corresponding parking line image is generated for each parking line in the real-world parking space image.

[0087] The preset algorithms include, but are not limited to, clustering methods and region growing methods. Alternatively, Photoshop can be used to extract the parking line image. The parking line image and the parking background image should be the same size, for example, the same size as the image template below, which is [size missing]. Preferably, the area in the parking space line image other than the parking space lines is filled with a black background and uniformly rotated to the same direction (e.g., uniformly rotated to the left) for display. The length of the parking line is extended or truncated to the corresponding maximum length according to whether the parking space is horizontal or vertical (e.g., the maximum length for horizontal parking spaces is L1 in the specification, and the maximum length for vertical parking spaces is L2 in the specification). The parking space lines are also labeled (data needed for training deep learning models).

[0088] This embodiment generates a database based on actual collected real-world parking space images, and separates and combines real environmental data to make the generated parking space scene more realistic.

[0089] S3. Obtain any parking space line image from the foreground database and identify it. Obtain parking space line features and generate reference parking space lines. Generate a set of target parking spaces according to the reference parking space lines and the preset distribution rules.

[0090] Specifically, obtaining parking space line features and generating reference parking space lines includes: calculating the width of the reference parking space line; and calculating the length of the reference parking space line.

[0091] In step S3, generating the target parking space set according to the reference parking space lines and the preset distribution pattern includes steps S31 to S35:

[0092] S31. Traverse the preset distribution patterns to obtain the target distribution pattern;

[0093] In this embodiment, the preset distribution pattern includes, but is not limited to, a first distribution pattern, a second distribution pattern, and a third distribution pattern, and the corresponding combined parking space image includes single-sided combined parking spaces (such as...). Figure 6 (1) of the parking spaces on opposite sides (e.g.) Figure 6 (2) of the middle section), adjacent side combination parking spaces (such as Figure 6 (3)); Single-sided combination parking spaces include single-sided parking spaces, opposite-sided combination parking spaces include sequential single-sided parking spaces and opposite-sided parking spaces, and adjacent-sided combination parking spaces include sequential single-sided parking spaces and adjacent-sided parking spaces.

[0094] In other embodiments, a single-sided parking space is not limited to the left side; therefore, a combination of opposite-sided parking spaces can be any two sets of opposite parking spaces, including front and back, left and right.

[0095] Based on the distribution patterns of parking spaces in real-world parking environments, this embodiment sets up a first, second, and third distribution pattern corresponding to single-sided combined parking spaces, opposite-sided combined parking spaces, and adjacent-sided combined parking spaces. These multiple distribution patterns multiply the original number of parking space images. At the same time, the parking spaces in the combined parking spaces are divided according to single-sided, opposite-sided, and adjacent-sided, making the parking space planning more systematic and facilitating subsequent target parking space planning, coordinate calculation, and combined parking space fusion.

[0096] S32. Obtain the reference parking space lines and parking space width range;

[0097] In this embodiment, the reference parking space line and parking space width range are obtained randomly each time. That is, taking the second distribution pattern as an example, the type of reference parking space line and the parking space width range of the single-sided parking space and the opposite-sided parking space can be different because they are obtained in two separate times, forming a pattern where one side is an angled parking space and the other side is a non-angled parking space, and one side is an I-type parking space and the other side is a T-type parking space.

[0098] Specifically, obtaining the reference parking line involves sequentially obtaining parking line images of the same type from the foreground database based on the current parking space's parking line distribution location (e.g., the left and right positions), and then obtaining the corresponding reference parking line.

[0099] In this embodiment, obtaining the parking space width range includes: obtaining the default maximum and minimum parking space widths; if the target parking space is an angled parking space, then updating the maximum and minimum parking space widths according to the angle of inclination, specifically:

[0100]

[0101] in, Maximum parking space width α represents the minimum parking space width, and α represents the tilt angle of the angled parking space.

[0102] This embodiment takes into account the diversity of parking space widths in the display, and sets a maximum parking space width and a minimum parking space width to form a range of parking space widths, thereby covering parking space scenarios with different widths.

[0103] S33. Based on the parking space type in the target distribution pattern, call the corresponding threshold adjustment strategy to set the space threshold.

[0104] See Figure 2 Due to the characteristics of angled parking spaces, space thresholds need to be set on both sides according to the distribution of parking spaces. In this embodiment, the required empty space on both sides of the target parking space is preset to be as follows: (Pixel units in the image template).

[0105] In this embodiment, when the parking space type is a single-sided parking space or a cross-sided parking space, the threshold adjustment strategy includes:

[0106] A1. Determine if the target parking space is an angled parking space. If not, proceed directly to step S34. If yes, proceed to the next step.

[0107] A2. Then, based on the angle of inclination of the angled parking space and the reference parking line, a space threshold is set, specifically as follows:

[0108] If the angled parking space is angled upwards, then calculate the space threshold for the side furthest from the angled parking space:

[0109] ;

[0110] If the angled direction of the angled parking space is downward, then calculate the spatial threshold on the angled side of the angled parking space;

[0111] ;

[0112] in, , The initial value is a preset threshold, which can be customized according to actual needs (for example, if the distance between the parking space and the boundary is 10cm, and one pixel on the image represents 2cm, then the initial value is 5). (This value is a random value within the specification - the length of the parking space line) is the length of the reference parking space line, and α is the tilt angle of the angled parking space.

[0113] In this embodiment, when the parking space type is an adjacent parking space, the threshold adjustment strategy includes:

[0114] B1. Determine if the target parking space is an angled parking space. If not, proceed directly to step S34. If yes, proceed to the next step.

[0115] B2. Obtain the parking space planning data for the single-sided parking spaces corresponding to the current target distribution pattern, and extract the maximum value of the expanded parking spaces on the horizontal and vertical axes from the parking space planning data (e.g., extract the maximum value from the previously generated left-side parking spaces). (Maximum value in direction) B3, then set the space threshold according to the tilt angle of the angled parking space and the reference parking line, specifically as follows;

[0116] If the diagonal direction of the adjacent parking space is to the left, calculate the space threshold of the diagonal parking space away from the left and proceed to step B4:

[0117] ;

[0118] If the adjacent parking space is angled to the right, calculate the space threshold on the angled side of the parking space and proceed to step B4;

[0119] ;

[0120] B4. Determine whether the vertical free space on the adjacent side meets the parking space planning requirements. If not, keep the original space threshold unchanged. If yes, proceed to the next step.

[0121] In this embodiment, the parking space planning requirement is that the remaining vacant space is greater than or equal to the sum of the preset passage gap and the vertical length of the parking space, that is:

[0122] ;

[0123] Where n is the preset passage gap, y is the ordinate of the maximum value on the x and y coordinates, l is the length of the reference parking space line, α is the tilt angle of the inclined parking space, and h is the width or height of the combined parking space image.

[0124] B5. When the angled direction of a single-sided parking space is downward and the angled direction of the adjacent parking space is left, calculate the space threshold for the side furthest from the angled parking space:

[0125] ;

[0126] When the angled direction of a single-sided parking space is downward and the angled direction of the adjacent parking space is to the right, the spatial threshold for the side furthest from the angled parking space is calculated:

[0127] .

[0128] Where n is the preset passage gap, α is the x-coordinate of the maximum value on the x and y coordinates, l is the length of the reference parking line, and α is the tilt angle of the inclined parking space.

[0129] This embodiment is based on the difference between angled parking spaces and rectangular parking spaces. It specifically classifies and calculates the spatial threshold in the planning of angled parking spaces. It further refines and classifies the space according to the angled direction and the distribution location of the target parking spaces, so as to cover the distribution scenarios of angled parking spaces and rectangular parking spaces. The parking space data in the scenario is real and reasonable.

[0130] S34. Based on the spatial threshold, reference parking space lines, and parking space width range, call the parking space planning strategy to generate each side of the combined parking space image. Determine whether the combined parking space image is complete. If yes, merge each side of the combined parking space image and proceed to the next step; otherwise, return to step S32. (In this embodiment, the parking space planning strategy includes C1~C7:)

[0131] C1. Randomly select a target parking space width from the range of parking space widths, and obtain the preset number of parking spaces;

[0132] In this embodiment, the preset number of parking spaces is randomly obtained, and a range of parking spaces can be set for random selection.

[0133] C2. Calculate the maximum number of parking spaces on any side of the image template based on the spatial threshold and the target parking space width, and determine the number of parking spaces to be generated based on the preset number of parking spaces and the parking space number threshold.

[0134]

[0135] in To standardize the minimum width of inner parking space lines;

[0136] like ,but ,otherwise And on Initialize ;

[0137] in, This is a threshold for the number of parking spaces. The preset number of parking spaces (corresponding to parking spaces on each side). The number of parking spaces to be generated is the difference between the preset number of parking spaces and the number of parking spaces already generated. Indicates the end position.

[0138] C3. Determine the starting position of the target parking space in the image template, determine the ending position of the target parking space based on the width of the target parking space, generate the target parking space in the image template based on the starting and ending positions, and store the corresponding coordinate data;

[0139] In this embodiment, the formulas for selecting the start and end positions are as follows:

[0140]

[0141]

[0142] in The width of the selected parking space line. It depends on whether it's the first calculation. , ,otherwise .

[0143] Rand means random selection. Indicates the starting position. This indicates that the initialization point was missing at the end position. Please refer to the original text. Indicates the width of the target parking space;

[0144] like and ,but (That is, two parking spaces share the middle parking line).

[0145] This indicates the minimum clearance between two parking spaces.

[0146] C4. Update the number of parking spaces to be generated. and judge If the value is 0, proceed to step C6; otherwise, calculate the remaining free space.

[0147] ;

[0148] in, For the remaining free space, This is the end position of the target parking space.

[0149] C5. Determine whether the remaining vacant space is less than the minimum value of the parking space width range. If yes, proceed to step C6; otherwise, return to step C3.

[0150] C6. Check if the target parking space generated by the current edge is an angled parking space. If not, proceed to step C7. If yes, perform an affine transformation on the target parking space according to the shape of the reference parking space line and record its coordinate data.

[0151] In this embodiment, performing an affine transformation on the target parking space based on the shape of the reference parking space line includes:

[0152] a. Determine if the shape of the reference parking space line is "T" shaped (see...). Figure 4 If the target parking space is not selected, proceed to the next step. If selected, perform an affine transformation on the target parking space and apply a smooth transition. Specifically, taking an example where the origin of the coordinate system is on the left side of the image template:

[0153] like The processing formula is as follows:

[0154]

[0155]

[0156] otherwise, Then proceed to step b.

[0157] b. Perform an affine transformation on the target parking space. The formula for the affine transformation is as follows:

[0158]

[0159]

[0160] in, It is a slanted directional sign. A value of 1 indicates that the parking space on the left is angled downwards. -1 indicates that the left parking space is angled upwards. Here are the coordinates of the "T"-shaped intersection, and (x, y) are the coordinate data from step D3.

[0161] In this embodiment, see Figure 4 If the parking space lines have labeled data, the labeled data and the coordinate data are updated according to the above formula.

[0162] This embodiment takes into account the characteristics of angled parking spaces. Based on the uniqueness of the "T" parking space line, two sets of affine transformation processing formulas are set to smooth the target parking space, thereby making the transition of the parking space line of the target parking space in the simulated real-world parking space more natural and the image clearer.

[0163] C7. Integrate the coordinate data of each target parking space.

[0164] This embodiment randomly selects the target parking space width within the parking space width range, thus covering parking space scenarios with different widths. By randomly setting the number of preset parking spaces according to the user's intention and combining it with the starting position of the randomly selected target parking space, it is also possible to further achieve coverage of parking space scenarios with different numbers of parking spaces and different distribution areas, thereby further expanding the number of simulated real-world parking spaces.

[0165] In this embodiment, taking a single-sided parking space as an example (left-side parking space), each side of the merged parking space image includes:

[0166] When the preset distribution pattern is the first distribution pattern, draw a single-sided parking space in the image template according to the coordinate data and the reference parking space line;

[0167] When the preset distribution pattern is the second distribution pattern, the single-sided parking space will be drawn in the image template according to the coordinate data of the single-sided parking space and the reference parking space line, and then the coordinate data of the opposite-sided parking space after horizontal flipping will be obtained to draw the opposite-sided parking space.

[0168] When the preset distribution pattern is the third distribution pattern, the single-sided parking space will be drawn in the image template according to the coordinate data of the single-sided parking space and the reference parking space line, and then the coordinate data of the adjacent parking space will be obtained by rotating it counterclockwise by 90° to draw the adjacent parking space.

[0169] See Figure 3 The target parking space set in this embodiment includes, but is not limited to, independently generated single-sided combination parking spaces, opposite-sided combination parking spaces, and adjacent-sided combination parking spaces. Taking the single-sided parking space as the left-side parking space as an example, the first to third distribution patterns are traversed, specifically as follows:

[0170] 1. Generate a single-sided combination parking space; simply plan to obtain a set of single-sided parking spaces.

[0171] 2. Generate opposite-side combined parking spaces. First, plan a set of single-sided parking spaces, and then generate another set of single-sided parking spaces. After horizontally flipping the other set of single-sided parking spaces, you get opposite-sided parking spaces. Then, fuse the images of the single-sided parking spaces and opposite-sided parking spaces to obtain opposite-side combined parking spaces.

[0172] When a single-sided parking space is converted to an opposite-sided parking space, its vertical coordinate remains unchanged, while its horizontal coordinate after the flip is: , ( (The x-coordinate before flipping).

[0173] 3. Generate adjacent side combination parking spaces. First, plan a set of single-sided parking spaces, and then generate another set of single-sided parking spaces. After rotating the other set of single-sided parking spaces 90° counterclockwise, the adjacent side parking spaces are obtained. The single-sided parking spaces and the adjacent side parking spaces are image fused to obtain adjacent side combination parking spaces.

[0174] The formula for converting a single-sided parking space to an adjacent-sided parking space is as follows:

[0175]

[0176] (x,y) are the coordinates of a single-sided parking space; , ) represents the coordinates of the adjacent parking space after flipping, and h represents the height and width of the image template.

[0177] In this embodiment, when creating combined parking space images, the planning is first carried out in the form of single-sided parking spaces. Then, according to different distribution patterns, the image is flipped to obtain the coordinate data of the corresponding opposite or adjacent parking spaces, which can further reduce the difficulty of parking space planning and improve the efficiency of parking space planning.

[0178] S35. Control the combined parking space image to rotate around its own image center by a preset rotation angle, and obtain the coordinate data of each target parking space after rotation to generate a set of target parking spaces;

[0179] Among them, the preset rotation angle If the rotation direction is counterclockwise or clockwise, the formula for calculating the rotation coordinate data is as follows:

[0180] ;

[0181] );

[0182] Where (x, y) are the coordinates of the target parking space in the combined parking space image before rotation; , ) represents the coordinates of the target parking space after rotation in the combined parking space image.

[0183] In this embodiment, see Figure 4 If the parking space lines have labeled data, the labeled data and the coordinate data are updated according to the above formula.

[0184] S4. Fuse each target parking space in the target parking space set with the corresponding parking space background image in the background database to obtain a simulated real-world parking space set. Alternatively, it may also include calculating the annotation data corresponding to each target parking space and outputting it in JSON file format.

[0185] In this embodiment, the parking space background images corresponding to the background database are images with similar backgrounds but different weather conditions. For example, the parking space lines of the current target parking space are extracted from the cement ground background. When combining them, the backgrounds of the parking space lines on the cement ground background under different weather conditions are obtained. Different weather conditions include rainy days, snowy days, sunny days, etc.

[0186] In other embodiments, parking spaces on three sides can also be planned according to the parking space planning principle of this embodiment, for example, generating two sets of adjacent parking spaces on both sides of a single-sided parking space.

[0187] This invention, based on the scenario requirements of deep learning algorithms in image recognition technology, extracts parking line images from acquired real-world parking space images to generate a foreground database and parking space background images (excluding parking lines) to generate a background database. By separating and combining parking line and background images, the number of simulated real-world parking spaces can be effectively expanded. Furthermore, reference parking lines are generated by acquiring the parking line features of any parking line image, and a target parking space set is generated according to the reference parking lines and a preset distribution pattern. The number of simulated real-world parking spaces is further expanded by forming parking space images with different preset distribution patterns, thereby reducing the difficulty and cost of data acquisition, improving scene coverage, and ultimately improving image recognition efficiency.

[0188] The above embodiments are preferred embodiments of the present invention, but the embodiments of the present invention are not limited to the above embodiments. Any changes, modifications, substitutions, combinations, or simplifications made without departing from the spirit and principle of the present invention shall be considered equivalent substitutions and shall be included within the protection scope of the present invention.

Claims

1. A method for expanding parking space data, characterized in that, Including the following steps: S1. Collect different real-world parking space images; S2. Identify each of the real-world parking space images, extract the parking space line image and the parking space background image other than the parking space line, and import them into the foreground database and background database respectively. S3. Obtain and identify any of the parking line images from the foreground database, obtain parking line features and generate reference parking lines, and generate a target parking space set according to the reference parking lines and a preset distribution pattern. S4. Fuse each target parking space in the target parking space set with the corresponding parking space background image in the background database to obtain a simulated real-world parking space set. In step S3, generating the target parking space set according to the reference parking space lines and the preset distribution pattern includes the following steps: S31. Traverse the preset distribution patterns to obtain the target distribution pattern; S32. Obtain the reference parking space line and the parking space width range; S33. Based on the parking space type in the target distribution pattern, call the corresponding threshold adjustment strategy to set the space threshold; S34. Based on the spatial threshold and the reference parking space line and parking space width range, call the parking space planning strategy to generate each side of the combined parking space image, determine whether the combined parking space image is complete, if yes, merge each side of the combined parking space image and proceed to the next step, if no, return to step S32. S35. Control the combined parking space image to rotate around its own image center by a preset rotation angle, and obtain the coordinate data of each target parking space after rotation to generate a target parking space set. The preset distribution patterns include a first distribution pattern, a second distribution pattern, and a third distribution pattern. The corresponding combined parking space images include single-sided combined parking spaces, opposite-sided combined parking spaces, and adjacent-sided combined parking spaces. The single-sided combined parking spaces include single-sided parking spaces; the opposite-sided combined parking spaces include sequential single-sided parking spaces and opposite-sided parking spaces; and the adjacent-sided combined parking spaces include sequential single-sided parking spaces and adjacent-sided parking spaces. When the parking space type is a single-sided parking space or a cross-sided parking space, the threshold adjustment strategy includes: A1. Determine if the target parking space is an angled parking space. If not, proceed directly to step S34. If yes, proceed to the next step. A2. Then, based on the tilt angle of the inclined parking space and the reference parking space line, a space threshold is set: When the parking space type is an adjacent parking space, the threshold adjustment strategy includes: B1. Determine if the target parking space is an angled parking space. If not, proceed directly to step S34. If yes, proceed to the next step. B2. Obtain the parking space planning data of the single-sided parking spaces corresponding to the current target distribution pattern, and obtain the maximum value of the expanded parking spaces on the horizontal and vertical coordinates from the parking space planning data; B3. Then, set a space threshold based on the tilt angle of the inclined parking space and the reference parking space line; B4. Determine whether the vertical free space on the adjacent side meets the parking space planning requirements. If not, keep the original space threshold unchanged. If yes, proceed to the next step. B5. When the slant direction of a single-sided parking space is downward, the spatial threshold of the slant parking space away from the adjacent parking space is calculated according to whether the slant direction of the adjacent parking space is left or right.

2. The method for expanding parking space data as described in claim 1, characterized in that, The specific steps of step S2 are as follows: using a preset algorithm to extract parking line images and parking space background images other than parking lines from the real-scene parking space images, and importing the parking line images and parking space background images into the corresponding areas of the foreground database and background database according to the classification criteria for storage. The classification criteria include different weather conditions, indoor / outdoor conditions, vehicle type, road surface, and parking line color. The preset algorithm includes clustering methods or region growing methods.

3. The method for expanding parking space data as described in claim 2, characterized in that, In step A2, a spatial threshold is set based on the tilt angle of the angled parking space and the reference parking space line, specifically as follows: If the angled parking space is angled upwards, then calculate the space threshold on the side furthest from the angled parking space: ; If the angled direction of the angled parking space is downward, then calculate the spatial threshold of the angled parking space on the tilt side; ; in, , The initial value is a preset threshold. The length of the reference parking space line is α, and the tilt angle of the slanted parking space is α.

4. The method for expanding parking space data as described in claim 3, characterized in that, In step B3, a spatial threshold is set based on the tilt angle of the angled parking space and the reference parking space line, specifically as follows: When the diagonal direction of the adjacent parking space is to the left, calculate the spatial threshold of the diagonal parking space on the side furthest away and proceed to step B4: ; When the adjacent parking space is angled to the right, calculate the spatial threshold of the angled parking space on the tilted side and proceed to step B4; ; In step B5, when the diagonal direction of a single-sided parking space is downward and the diagonal direction of an adjacent parking space is left, the spatial threshold of the diagonal parking space furthest from the side is calculated: ; When the diagonal direction of a single-sided parking space is downward and the diagonal direction of an adjacent parking space is to the right, then calculate the spatial threshold of the diagonal parking space on the side furthest from it: ; Where n is the preset passage gap, Let l be the x-coordinate of the maximum value on the x and y coordinates, l be the length of the reference parking space line, and α be the tilt angle of the slanted parking space.

5. The method for expanding parking space data as described in claim 4, characterized in that, The parking space planning requirement is that the remaining vacant space is greater than or equal to the sum of the preset passage gap and the vertical length of the parking space, that is: Where n is the preset passage gap, y is the ordinate of the maximum value on the horizontal and vertical axes, l is the length of the reference parking space line, α is the tilt angle of the slanted parking space, and h is the width or height of the combined parking space image.

6. The method for expanding parking space data as described in claim 2, characterized in that, The parking space planning strategy includes: C1. Randomly select a target parking space width from the range of parking space widths, and obtain a preset number of parking spaces; C2. Calculate the maximum number of parking spaces on any side of the image template based on the spatial threshold and the target parking space width, and determine the number of parking spaces to be generated based on the preset number of parking spaces and the parking space number threshold. C3. Determine the starting position of the target parking space in the image template, determine the ending position of the target parking space according to the width of the target parking space, generate the target parking space in the image template according to the starting position and the ending position, and store the corresponding coordinate data; C4. Update the number of parking spaces to be generated and determine if it is 0. If it is, proceed to step C6; otherwise, calculate the remaining available spaces. C5. Determine whether the remaining vacant space is less than the minimum value of the parking space width range. If yes, proceed to step C6; otherwise, return to step C3. C6. Is the target parking space generated by the current side an angled parking space? If not, proceed to step C7. If yes, perform an affine transformation on the target parking space according to the shape of the reference parking space line and record its coordinate data. C7. Integrate the coordinate data of each target parking space.

7. A method for expanding parking space data as described in claim 6, characterized in that, In step C6, performing an affine transformation on the target parking space based on the shape of the reference parking space line includes: a. Determine if the shape of the reference parking space line is "T". If not, proceed to the next step. If yes, perform an affine transformation on the target parking space and apply a smooth transition. Specifically: when the origin of the coordinate system is on the left side of the image template, if... The processing formula is as follows: Otherwise, if Then proceed to step b; b. Perform an affine transformation and translation on the target parking space. The translation process is as follows: in, It is a slanted directional sign. A value of 1 indicates that the parking space on the left is angled downwards. -1 indicates that the left parking space is angled upwards. Here are the coordinates of the "T"-shaped intersection, and (x, y) are the coordinate data from step D3.

8. A method for expanding parking space data as described in claim 3, characterized in that, In step S32, obtaining the parking space width range includes: obtaining the default maximum and minimum parking space widths; if the target parking space is an angled parking space, updating the maximum and minimum parking space widths according to the angle of inclination, specifically: in, Maximum parking space width α is the minimum parking space width, and α is the tilt angle of the angled parking space.

9. A method for expanding parking space data as described in claim 6, characterized in that, Taking a single-sided parking space as an example (left-side parking space), each side of the combined parking space image includes: When the preset distribution pattern is the first distribution pattern, draw a single-sided parking space in the image template according to the coordinate data and the reference parking space line; When the preset distribution pattern is the second distribution pattern, the single-sided parking space will be drawn in the image template according to the coordinate data of the single-sided parking space and the reference parking space line, and then the coordinate data of the opposite-sided parking space after horizontal flipping will be obtained to draw the opposite-sided parking space. When the preset distribution pattern is the third distribution pattern, the single-sided parking space will be drawn in the image template according to the coordinate data of the single-sided parking space and the reference parking space line, and then the coordinate data of the adjacent parking space after being flipped 90° to the right will be obtained to draw the adjacent parking space.

Citation Information

Patent Citations

  • Parking space training sample generation method

    CN115439717A