A parking space determination method and device, computer equipment and storage medium
By determining the pixel coordinates of parking spaces and vehicles in the parking space layout template and utilizing the regional association relationship of the parking space simulation area, the problem of low data processing efficiency in parking space detection is solved, and fast and accurate parking space matching is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ZHEJIANG UNIVIEW TECH CO LTD
- Filing Date
- 2022-09-29
- Publication Date
- 2026-07-31
AI Technical Summary
In scenarios with a large number of parking spaces and vehicles, existing technologies suffer from low data processing efficiency and poor convenience in image processing.
By acquiring parking images and loading parking space layout templates, the pixel coordinates of parking spaces and vehicles are determined, and the parking relationship between vehicles and parking spaces is quickly matched based on the regional association relationship of the simulated parking space area in the parking space layout template.
It improves data processing efficiency and convenience, enabling quick determination of the parking space where the vehicle is parked, and reduces data processing operations for image feature comparison.
Smart Images

Figure CN117831331B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of image processing technology, and in particular relates to a parking space determination method, apparatus, computer equipment and storage medium. Background Technology
[0002] Currently, to improve the intelligence of vehicle parking and parking space management, there are outdoor parking space detection methods for outdoor parking lots. These methods can detect parking spaces within the field of view and obtain parking space coordinate information. At the same time, they can further detect the image features of the parking space area by using image processing such as parking space cropping, smoothing filtering, and color image grayscale conversion. They can also compare the variance, correlation, edge point density, and number of lines between the image data inside the parking space and the vehicle image data. After comparing the image features, it can be determined whether there is a car or not in the current parking space.
[0003] The above solution can determine whether a vehicle is parked in a parking space. However, in scenarios with a large number of parking spaces and a large number of parked vehicles, the image processing requires collecting too many image features and the data processing operations for feature comparison will also increase exponentially. This results in low data processing efficiency and poor convenience when determining the parking relationship between parked vehicles and parking spaces. Summary of the Invention
[0004] This application provides a parking space determination method, apparatus, computer equipment, and storage medium to solve the problems of low data processing efficiency and poor convenience in the prior art.
[0005] The first aspect of this application provides a parking space determination method, including:
[0006] Acquire a parking image and load a parking space layout template; the parking space layout template contains multiple sequentially arranged parking space simulation areas;
[0007] Determine the first pixel coordinates of each parking space and the second pixel coordinates of the target parked vehicle in the parking image;
[0008] Based on the parking space layout template, determine the first parking space simulation area in which each first pixel coordinate falls within the parking space layout template, and determine the second parking space simulation area in which the second pixel coordinate falls within the parking space layout template.
[0009] Based on the regional association between the second parking space simulation area and the first parking space simulation area in the parking space layout template, the target parking space to which the target parked vehicle belongs is determined.
[0010] A second aspect of this application provides a parking space determination device, comprising:
[0011] The first acquisition module is used to acquire parking images and load parking space layout templates; the parking space layout templates contain multiple sequentially arranged parking space simulation areas;
[0012] The second acquisition module is used to determine the first pixel coordinates of each parking space in the parking image and the second pixel coordinates of the target parked vehicle.
[0013] The region determination module is used to determine, based on the parking space layout template, the first parking space simulation region in which each first pixel coordinate falls within the parking space layout template, and the second parking space simulation region in which the second pixel coordinate falls within the parking space layout template.
[0014] The parking space determination module is used to determine the target parking space to which the target parked vehicle belongs based on the regional association relationship between the second parking space simulation area and the first parking space simulation area in the parking space layout template.
[0015] A third aspect of this application provides a computer device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the method described in the first aspect.
[0016] A fourth aspect of this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the method described in the first aspect.
[0017] The fifth aspect of this application provides a computer program product that, when run on a computer device, causes the computer device to perform the steps of the method described in the first aspect.
[0018] As can be seen from the above, in this embodiment of the application, by determining the first pixel coordinates of each parking space in the parking image and the second pixel coordinates of the target parked vehicle, based on the parking space layout template, the first simulated parking space area in which each first pixel coordinate falls in the parking space layout template is determined, and the second simulated parking space area in which the second pixel coordinate falls in the parking space layout template is determined. Based on the regional association relationship between the second simulated parking space area and the first simulated parking space area in the parking space layout template, the target parking space to which the target parked vehicle belongs is determined. By utilizing the simulated parking space areas arranged in the parking space layout template, and based on the regional relationship between the area in which the parking space pixel coordinates fall and the area in which the vehicle pixel coordinates fall, the parking space to which the vehicle is parked can be quickly found through the vehicle coordinates, thereby improving data processing efficiency and processing convenience. Attached Figure Description
[0019] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 This is a flowchart of a parking space determination method provided in an embodiment of this application. Figure 1 ;
[0021] Figure 2 This is a schematic diagram illustrating the search for a simulated parking space area provided in an embodiment of this application;
[0022] Figure 3 This is a flowchart of a parking space determination method provided in an embodiment of this application. Figure 2 ;
[0023] Figure 4 This is a schematic diagram of the minimum parking space provided in the embodiments of this application;
[0024] Figure 5 This is a schematic diagram of the longitudinal axis imaging of the parking space provided in an embodiment of this application;
[0025] Figure 6 This is a schematic diagram of the transverse axis imaging of a parking space provided in an embodiment of this application;
[0026] Figure 7 This is a structural diagram of a parking space determination device provided in an embodiment of this application;
[0027] Figure 8 This is a structural diagram of a computer device provided in an embodiment of this application. Detailed Implementation
[0028] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.
[0029] It should be understood that, when used in this specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or collections thereof.
[0030] It should also be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the scope of the application. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.
[0031] It should also be further understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0032] As used in this specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrases "if determined" or "if [described condition or event] is detected" may be interpreted, depending on the context, as "once determined," "in response to determination," "once [described condition or event] is detected," or "in response to detection of [described condition or event]."
[0033] In specific implementations, the computer devices described in the embodiments of this application include, but are not limited to, other portable devices such as mobile phones, laptop computers, or tablet computers with touch-sensitive surfaces (e.g., touchscreen displays and / or touchpads). It should also be understood that in some embodiments, the device is not a portable communication device, but a desktop computer with touch-sensitive surfaces (e.g., touchscreen displays and / or touchpads).
[0034] The following discussion describes computer devices including displays and touch-sensitive surfaces. However, it should be understood that computer devices may include one or more other physical user interface devices such as physical keyboards, mice, and / or joysticks.
[0035] Computer devices support a variety of applications, such as one or more of the following: drawing applications, presentation applications, word processing applications, website creation applications, disc burning applications, spreadsheet applications, game applications, telephone applications, video conferencing applications, email applications, instant messaging applications, exercise support applications, photo management applications, digital camera applications, digital camcorder applications, web browsing applications, digital music player applications, and / or digital video player applications.
[0036] Various applications that can run on a computer device can use at least one common physical user interface device, such as a touch-sensitive surface. One or more functions of the touch-sensitive surface and the corresponding information displayed on the computer device can be adjusted and / or changed between and / or within applications. In this way, the common physical architecture of the computer device (e.g., the touch-sensitive surface) can support various applications with user interfaces that are intuitive and transparent to the user.
[0037] It should be understood that the sequence number of each step in this embodiment does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of this application embodiment.
[0038] To illustrate the technical solution described in this application, specific embodiments are provided below.
[0039] See Figure 1 , Figure 1 This is a flowchart of a parking space determination method provided in an embodiment of this application. Figure 1 .like Figure 1 As shown, a parking space determination method includes the following steps:
[0040] Step 101: Obtain the parking image and load the parking space layout template.
[0041] The parking space layout template includes multiple sequentially arranged parking space simulation areas. Each parking space simulation area is formed by simulating the arrangement of parking spaces and the parking area of each space within the parking space layout template.
[0042] Specifically, the area size of each parking space simulation area is the same. Alternatively, the area size of each parking space simulation area can be determined according to a set size increase / decrease rule.
[0043] The arrangement rules among multiple parking space simulation areas can be based on row and column numbers. Each parking space simulation area is denoted as Templateij, where i is the row number (1 to n) and j is the column number (1 to m). This constructs an n*m two-dimensional matrix of parking space simulation areas, forming a parking space arrangement template.
[0044] Step 102: Determine the first pixel coordinates of each parking space and the second pixel coordinates of the target parked vehicle in the parking image.
[0045] The coordinates of the first pixel and the second pixel form the position reference coordinate point.
[0046] The coordinates of the first pixel can be the coordinates of a geometric location point of each parking space in the parking image.
[0047] Similarly, the second pixel coordinates can be the coordinates of a geometric location point of the target parked vehicle in the parking image.
[0048] This geometric location point is, for example, the center point, the golden ratio section point, or a reference point determined by other means.
[0049] In an optional implementation, determining the first pixel coordinates of each parking space and the second pixel coordinates of the target parked vehicle in the parking image includes:
[0050] Identify the first contour pixel of each parking space and the second contour pixel of the target parked vehicle from the parking image;
[0051] The center pixel coordinates of the parking space are obtained based on the first contour pixel point of each parking space, and the center pixel coordinates of the parking space are determined as the first pixel coordinates.
[0052] The vehicle center pixel coordinates are obtained based on the second contour pixel points of the target parked vehicle, and the vehicle center pixel coordinates are determined as the second pixel coordinates.
[0053] Alternatively, determining the first pixel coordinates of each parking space and the second pixel coordinates of the target parked vehicle in the parking image includes:
[0054] Extract the center pixel coordinates of the parking space corresponding to each parking space in the parking image from the pre-calibration information of the parking space, and determine the center pixel coordinates of the parking space as the first pixel coordinates;
[0055] Identify the second contour pixels of the target parked vehicle from the parking image;
[0056] The vehicle center pixel coordinates are obtained based on the second contour pixel points of the target parked vehicle, and the vehicle center pixel coordinates are determined as the second pixel coordinates.
[0057] In this process, the first pixel coordinate of the parking space is the center pixel coordinate of the parking space determined based on the outline pixels of the parking space, and the second pixel coordinate of the target parked vehicle is the center pixel coordinate of the vehicle determined based on the outline pixels of the target parked vehicle.
[0058] Contour recognition enables the determination of the coordinates of the center pixel, improving the ease of calculating the position reference coordinates and the accuracy of subsequent matching.
[0059] Step 103: Based on the parking space layout template, determine the first parking space simulation area in which each first pixel coordinate falls within the parking space layout template, and determine the second parking space simulation area in which the second pixel coordinate falls within the parking space layout template.
[0060] Pixel coordinates can be matched in the parking space layout template to determine the parking space simulation area in which the corresponding coordinates fall within the parking space layout template, and then the relationship between parking spaces and vehicles can be matched based on the parking space simulation area in which they fall.
[0061] Step 104: Based on the regional association between the second parking space simulation area and the first parking space simulation area in the parking space layout template, determine the target parking space to which the target parked vehicle belongs.
[0062] The regional relationship can be a relative positional relationship. Specifically, the regional relationship can include the relationship that the second parking space simulation area and the first parking space simulation area are the same area, the relationship that the second parking space simulation area and the first parking space simulation area are adjacent areas, or other positional relationships that the second parking space simulation area and the first parking space simulation area are different and not adjacent.
[0063] When determining the target parking space to which a target parked vehicle belongs based on regional relationships, one optional implementation method specifically includes:
[0064] If the simulated area of the second parking space of the target parked vehicle is the same as the simulated area of the first parking space of the first parking space, the first parking space is determined as the target parking space to which the target parked vehicle belongs.
[0065] That is, when the second parking space simulation area and the first parking space simulation area are associated with the same area, it is considered that the pixel coordinates of a parking space and the pixel coordinates of the target parked vehicle fall into the same parking space simulation area, and the parking space can be directly identified as the target parking space where the target parked vehicle is parked.
[0066] In another optional implementation, when determining the target parking space to which the target parked vehicle belongs based on regional association, the specific steps include:
[0067] If the simulated area of the first parking space of all parking spaces is not the same simulated area as the simulated area of the second parking space of the target parked vehicle, then at least one second parking space is determined from the different parking spaces where the simulated areas of the first parking space and the simulated areas of the second parking space are adjacent.
[0068] The target parking space to which the target parked vehicle belongs is determined from at least one of the second parking spaces.
[0069] That is, when the pixel coordinates of a parking space and the pixel coordinates of the target parked vehicle do not fall into the same parking space simulation area, it is necessary to determine whether the adjacent area of the parking space simulation area into which the pixel coordinates of the target parked vehicle fall is the area into which the pixel coordinates of one or more parking spaces fall.
[0070] If the determination is yes, then the target parking space where the target vehicle is parked can be determined from the one or more parking spaces.
[0071] In one example, this process combines... Figure 2 As shown, the solid-lined rectangular areas in the figure represent simulated parking spaces, and the two-dimensional matrix formed by these simulated areas serves as a parking space layout template. The dashed-lined rectangular areas represent the parking space areas identified in the parking image. The center pixel coordinates of the parking space, ParkingSlot-K, can be determined based on these parking space areas. The center pixel coordinates of the vehicle, Plate(a), can be determined based on the vehicles identified in the parking image.
[0072] Figure 2 In practice, factors such as the image acquisition angle or the fact that parking spaces in actual parking lots are angled can cause the orientation of parking spaces and vehicles in the acquired parking images to differ from the orientation of parking spaces in the simulated parking area. Therefore, the method proposed in this application can successfully detect the parking relationship between parking spaces and vehicles without being affected by the aforementioned factors.
[0073] exist Figure 2 In the simulation, the parking space simulation area where the center point pixel coordinates of the vehicle fall is region qp, and no parking space center point pixel coordinates fall within this simulation area. This situation is considered to be caused by factors such as non-standard vehicle parking, resulting in a situation where a vehicle is parked in a parking space, but the center point pixel coordinates of the parking space and the center point pixel coordinates of the parked vehicle do not fall into the same parking space simulation area.
[0074] At this point, it is necessary to determine whether the center point pixel coordinates of the vehicle fall within an adjacent region of the parking space simulation area, and whether there is a corresponding parking space center point pixel coordinate. If so, at least one second parking space can be identified. This at least one second parking space is the one where the first parking space simulation area and the second parking space simulation area are adjacent regions.
[0075] from Figure 2 From the data, we can see that the center pixel coordinates of the two parking spaces fall into the simulated parking space regions qp-1 and q+1p, respectively. Both of these parking spaces are second parking spaces, and we need to select one of them as the target parking space for the target vehicle.
[0076] In one specific implementation, determining the target parking space to which the target parked vehicle belongs from at least one second parking space includes:
[0077] If there is only one second parking space, then the second parking space is determined as the target parking space to which the target vehicle belongs; if there are multiple second parking spaces, then the parking space with the closest distance between the first pixel coordinate and the second pixel coordinate is determined as the target parking space to which the target vehicle belongs.
[0078] Combination Figure 2 As shown, there are two parking spaces for the second time. Therefore, it's necessary to determine which parking space's center pixel coordinate (ParkingSlot-K) is closer to the vehicle's center pixel coordinate (Plate(a)). The parking space corresponding to the closer center pixel coordinate is then identified as the target parking space for the target vehicle. Figure 2 In the end, the parking space corresponding to the center pixel coordinates of the parking space falling into the qp-1 parking space simulation area is determined as the target parking space to which the target parked vehicle belongs.
[0079] Furthermore, in an optional implementation, it also includes:
[0080] If the simulated first parking space area of all parking spaces is not the same simulated second parking space area of the target parked vehicle, and the simulated second parking space area does not contain any of the simulated first parking space areas, then it is determined whether the outline corner points of the target parked vehicle fall into the simulated parking space area.
[0081] If the determination result is that none of the outline corner points of the target parked vehicle fall into the parking space simulation area, then the target parked vehicle is determined to be a temporary parking vehicle.
[0082] If the determination result is that the outline corner of the target parked vehicle falls into the parking space simulation area, then the target parked vehicle is determined to be an abnormally sized vehicle.
[0083] Specifically, the contour corner points are, for example, the four contour endpoints corresponding to the two sides of the front and rear of the vehicle. Based on the placement of these contour corner points within the simulated parking space area, it is determined whether the vehicle is a temporary parking space not yet occupied, or an abnormally large vehicle, and an anomaly marker is promptly added to alert on-site inspection.
[0084] In a specific implementation scenario, the above processing procedure involves the following steps:
[0085] 1. Mark the center pixel coordinates of the parking space as ParkingSlot-k. It is necessary to calibrate the center pixel coordinates of the parking space to determine the correspondence between the parking space and the parking space simulation area in the parking space layout template.
[0086] For example: (ParkingSlot-k)∈Templateij means that the center pixel coordinates of parking space k fall into the simulated parking space area in row i and column j.
[0087] 2. The vehicle center pixel coordinates are labeled Plate(a). The vehicle center pixel coordinates need to be calibrated to determine the correspondence between the vehicle and the parking space simulation area in the parking space layout template.
[0088] Specifically, the center pixel coordinates of a vehicle in a parking image are known, where the coordinates of a certain center pixel are Plate(a)(x) and Plate(a)(y).
[0089] Calculate: Plate(a)(x) / w = k, Plate(a)(y) / h = l, then consider Plate(a) to fall within the parking space simulation area Templatek,l, which is in rows k and columns l. Here, w and h are the width and length of the parking space simulation area in the parking space layout template.
[0090] If Plate(a) falls within the parking space simulation area of Template q, p, and (ParkingSlot-K)∈Template q, p, then it is considered that the vehicle corresponding to Plate(a) is parked in the parking space corresponding to ParkingSlot-k.
[0091] If Plate(a) falls within the parking space simulation area of Template q,p, but no parking space center pixel coordinates fall within the parking space simulation area of Template q,p, then search for the parking space center pixel coordinates that fall within the 8 adjacent parking space simulation areas surrounding this parking space simulation area.
[0092] If only one parking space center pixel coordinate falls within the 8 adjacent simulated parking space areas, then the corresponding parking space is determined to be the parking space where the vehicle corresponding to Plate(a) is parked.
[0093] If multiple parking space simulation areas all contain the center pixel coordinates of parking spaces, then the parking space corresponding to the center pixel coordinate of the parking space closest to Plate(a) is selected as the parking space where the vehicle corresponding to Plate(a) will park.
[0094] If none of the four corner points of the vehicle corresponding to Plate(a) fall within the simulated parking space center pixel coordinates in the adjacent eight parking space simulation areas, it is determined whether all four corner points of the vehicle are within the simulated parking space. If not, it is determined to be temporary parking and does not occupy a parking space. If some corner points are within the simulated parking space, the vehicle size is considered abnormal and it is marked as an abnormal event, which facilitates and quickly identifies vehicles temporarily parked on the road and abnormal parking events.
[0095] In this embodiment, by identifying the first pixel coordinates of each parking space and the second pixel coordinates of the target parked vehicle from the parking image, and based on the parking space layout template, the first simulated parking space area in which each first pixel coordinate falls within the parking space layout template is determined, and the second simulated parking space area in which the second pixel coordinate falls within the parking space layout template is determined. Based on the regional association relationship between the second simulated parking space area and the first simulated parking space area in the parking space layout template, the target parking space to which the target parked vehicle belongs is determined. By utilizing the simulated parking space areas arranged in the parking space layout template, and based on the regional relationship between the area in which the parking space pixel coordinates fall and the area in which the vehicle pixel coordinates fall, the parking space to which the vehicle is parked can be quickly found through the vehicle coordinates, thereby improving data processing efficiency and convenience.
[0096] This application also provides different implementations of the parking space determination method.
[0097] See Figure 3 , Figure 3 This is a flowchart of a parking space determination method provided in an embodiment of this application. Figure 2 .like Figure 3 As shown, a parking space determination method includes the following steps:
[0098] Step 301: Control the camera to acquire images of the parking space.
[0099] Step 302: Based on the parking space image and in accordance with the imaging principle, obtain the minimum parking space imaging size of the actual parking space in the camera imaging plane;
[0100] The parking space image contains parking spaces distributed in different locations. Combined with... Figure 4 As shown, when the camera captures images of parking spaces at the camera mounting point, the actual parking spaces distributed in different directions will appear as larger when closer and smaller when farther away in the image.
[0101] At this point, based on the parking space image and in accordance with imaging principles, the minimum imaging size of the actual parking space in the camera's imaging plane can be obtained, i.e., compared with... Figure 4 The imaging size of the parking space corresponding to the smallest parking space position.
[0102] Among them, the actual parking space corresponding to the smallest parking space imaging size in the camera imaging plane is the parking space with the farthest relative distance from the camera among the multiple parking spaces distributed in the camera image acquisition area.
[0103] Furthermore, the actual parking space corresponding to the smallest parking space imaging size in the camera's imaging plane is the parking space with the greatest relative distance to the camera in a set direction among the multiple parking spaces distributed in the camera's image acquisition area. This set direction is, for example, the direction in which the camera lens is pointing.
[0104] Step 303: Construct the parking space simulation area according to the minimum parking space imaging size;
[0105] Step 304: Arrange the multiple parking space simulation areas sequentially to obtain the parking space layout template.
[0106] The above processing procedure, based on parking space images and combined with imaging principles, obtains the minimum parking space imaging size in the camera's imaging plane. This minimum parking space imaging size can be directly used as the size of the parking space simulation area, or the area size of each parking space simulation area can be determined based on this minimum parking space imaging size according to a set size increase / decrease rule. Multiple parking space simulation areas are then arranged sequentially to obtain a parking space layout template. Selecting the minimum parking space imaging size to construct the parking space simulation area ensures that the first pixel coordinate of at most one parking space falls within one parking space simulation area, improving comparison efficiency while avoiding the construction of invalid parking space simulation areas that are too small to be matched.
[0107] This process utilizes the minimum parking space imaging size to construct a parking space layout template, ensuring that when the subsequent vehicle pixel coordinates and parking space pixel coordinates fall into the matching range, it fully considers the influencing factors of camera imaging, further improving the accuracy and efficiency of positioning.
[0108] Specifically, in practical applications, the width and length of the parking space simulation area can be set as w and h, respectively, and the minimum parking space imaging size needs to be estimated as the minimum parking space simulation area size.
[0109] Combination Figure 4 , Figure 5 and Figure 6 As shown, the vertical axis of the parking space refers to the side of the parking space that is parallel to the projection of the camera's optical axis onto the horizontal plane, and the horizontal axis of the parking space refers to the side of the parking space that is perpendicular to the projection of the camera's optical axis onto the horizontal plane.
[0110] exist Figure 5 and Figure 6 In the figure, LK and GH values represent the minimum imaging size of the parking space's horizontal and vertical axes on the camera's imaging plane, respectively.
[0111] The process of calculating GH is as follows:
[0112] Combination Figure 5 As shown, O is the optical center, FC is the principal optical axis, AB is the longitudinal axis of the actual parking space, AD is the distance from the camera mounting pole to the far end of the parking space, OD is the height of the camera mounting pole, and GH is the image of parking space AB on the camera imaging plane.
[0113] In actual installation, the lengths AB, AD, and OD are known.
[0114] Given: ∠AOD, ∠OCD, ∠COD, ∠OAB, right angle ∟EFO, right angle ∟ODC.
[0115] The farther the parking space is from the camera, the smaller it appears in the image. Therefore, the farthest parking space within the camera's field of view, i.e., point A, is chosen as the observation point for the smallest parking space. Thus, ∠OAD can be measured.
[0116] The process of calculating GH is as follows:
[0117] ∠AOD=90°-∠OAB
[0118] ∠BOD = Arctg(BD / OD)
[0119] ∠BOC=∠BOD-∠COD=Arctg(BD / OD)-∠COD
[0120] ∠AOC=∠AOD-∠COD
[0121] Since ∠BOC = ∠FOG, and OF is the focal length f.
[0122] Therefore: FG=tg(∠BOC)*f
[0123] Similarly, ∠AOC=∠FOH
[0124] Therefore: FH = tg(∠FOH) * f
[0125] =tg(∠AOD-∠COD)*f
[0126] Therefore: GH = FH - FG, the longitudinal axis imaging size of the edge parking space can be calculated, that is, GH is the width w of the parking space simulation area.
[0127] The LK calculation process is as follows:
[0128] Combination Figure 6 As shown, O is the optical center, FC is the principal optical axis, OD is the height of the camera pole, MN is the actual horizontal axis of the parking space, LK is the image of the horizontal axis of the parking space, and OF is the focal length f.
[0129] In actual installation, the following are known: lengths AM, OD, and OF.
[0130] Given: ∠OAD, ∟JFO, ∟ODC
[0131] Choose A and J, which are on the same plane (ACFG) as the optical axis, as the center point of the horizontal axis of the parking space and the imaging point of the center of the horizontal axis of the parking space, respectively. Therefore, ∟OAN and ∟OJL are both right angles.
[0132] The farther the parking space is from the camera, the smaller it appears in the image. Therefore, the furthest parking space within the camera's field of view is chosen as point A. Thus, ∠OAD can be measured. FJ is known, and its distance is half the distance to one side of the camera's imaging plane.
[0133] The process of calculating LK is as follows:
[0134] OA = OD / sin(∠OAD)
[0135] ∠AOC=∠AOD-∠COD
[0136] Since ∠AOC=∠FOJ, and OF is the focal length f.
[0137] Therefore, OJ = OF / cos(∠FOJ)
[0138] Therefore: LK=MN*OJ / OA, that is, LK is the length h of the parking space simulation area.
[0139] As calculated above: GH and LK values are the minimum imaging sizes of the parking space's horizontal and vertical axes on the camera's imaging plane, respectively.
[0140] Step 305: Obtain a parking image and load a parking space layout template; the parking space layout template contains multiple sequentially arranged parking space simulation areas.
[0141] The implementation process of this step is the same as that of step 101 in the aforementioned embodiments, and will not be repeated here.
[0142] Step 306: Determine the first pixel coordinates of each parking space and the second pixel coordinates of the target parked vehicle in the parking image.
[0143] The implementation process of this step is the same as that of step 102 in the aforementioned embodiments, and will not be repeated here.
[0144] Step 307: Based on the parking space layout template, determine the first parking space simulation area in which each first pixel coordinate falls within the parking space layout template, and determine the second parking space simulation area in which the second pixel coordinate falls within the parking space layout template.
[0145] The implementation process of this step is the same as that of step 103 in the aforementioned embodiments, and will not be repeated here.
[0146] Step 308: Based on the regional association between the second parking space simulation area and the first parking space simulation area in the parking space layout template, determine the target parking space to which the target parked vehicle belongs.
[0147] The implementation process of this step is the same as that of step 104 in the aforementioned embodiments, and will not be repeated here.
[0148] In this embodiment, by identifying the first pixel coordinates of each parking space and the second pixel coordinates of the target parked vehicle from the parking image, and based on the parking space layout template, the first simulated parking space area in which each first pixel coordinate falls within the parking space layout template is determined, and the second simulated parking space area in which the second pixel coordinate falls within the parking space layout template is determined. Based on the regional association relationship between the second simulated parking space area and the first simulated parking space area in the parking space layout template, the target parking space to which the target parked vehicle belongs is determined. By utilizing the simulated parking space areas arranged in the parking space layout template, and based on the regional relationship between the area in which the parking space pixel coordinates fall and the area in which the vehicle pixel coordinates fall, the parking space to which the vehicle is parked can be quickly found through the vehicle coordinates. Furthermore, the parking space layout template is constructed using the minimum parking space imaging size to ensure that when the subsequent vehicle pixel coordinates and parking space pixel coordinates are matched, the influence factors of camera imaging are fully considered, further improving the accuracy and efficiency of positioning.
[0149] See Figure 7 , Figure 7 This is a structural diagram of a parking space determination device provided in an embodiment of this application. For ease of explanation, only the parts related to the embodiment of this application are shown.
[0150] The parking space determination device 700 includes:
[0151] The first acquisition module 701 is used to acquire parking images and load parking space layout templates; the parking space layout templates contain multiple sequentially arranged parking space simulation areas;
[0152] The second acquisition module 702 is used to determine the first pixel coordinates of each parking space and the second pixel coordinates of the target parked vehicle in the parking image.
[0153] The region determination module 703 is used to determine, based on the parking space layout template, the first parking space simulation region in which each first pixel coordinate falls within the parking space layout template, and the second parking space simulation region in which the second pixel coordinate falls within the parking space layout template.
[0154] The parking space determination module 704 is used to determine the target parking space to which the target parked vehicle belongs based on the regional association relationship between the second parking space simulation area and the first parking space simulation area in the parking space layout template.
[0155] The second acquisition module 702 is specifically used for:
[0156] Identify the first contour pixel of each parking space and the second contour pixel of the target parked vehicle from the parking image;
[0157] The center pixel coordinates of the parking space are obtained based on the first contour pixel point of each parking space, and the center pixel coordinates of the parking space are determined as the first pixel coordinates.
[0158] The vehicle center pixel coordinates are obtained based on the second contour pixel points of the target parked vehicle, and the vehicle center pixel coordinates are determined as the second pixel coordinates; or...
[0159] Extract the center pixel coordinates of the parking space corresponding to each parking space in the parking image from the pre-calibration information of the parking space, and determine the center pixel coordinates of the parking space as the first pixel coordinates;
[0160] Identify the second contour pixels of the target parked vehicle from the parking image;
[0161] The vehicle center pixel coordinates are obtained based on the second contour pixel points of the target parked vehicle, and the vehicle center pixel coordinates are determined as the second pixel coordinates.
[0162] The parking space determination module 704 is specifically used for:
[0163] If the simulated area of the second parking space of the target parked vehicle is the same as the simulated area of the first parking space of the first parking space, the first parking space is determined as the target parking space to which the target parked vehicle belongs.
[0164] The parking space determination module 704 is specifically used for:
[0165] If the simulated area of the first parking space of all parking spaces is not the same simulated area as the simulated area of the second parking space of the target parked vehicle, then at least one second parking space is determined from the different parking spaces where the simulated areas of the first parking space and the simulated areas of the second parking space are adjacent.
[0166] The target parking space to which the target parked vehicle belongs is determined from at least one of the second parking spaces.
[0167] The parking space determination module 704 is specifically used for:
[0168] If there is only one second parking space, then the second parking space is determined as the target parking space to which the target parked vehicle belongs;
[0169] If there are multiple second parking spaces, the parking space with the closest distance between the first pixel coordinate and the second pixel coordinate is determined as the target parking space to which the target parked vehicle belongs.
[0170] The device also includes:
[0171] The exception detection module is used for:
[0172] If the simulated first parking space area of all parking spaces is not the same simulated second parking space area of the target parked vehicle, and the simulated second parking space area does not contain any of the simulated first parking space areas, then it is determined whether the outline corner points of the target parked vehicle fall into the simulated parking space area.
[0173] If the determination result is that none of the outline corner points of the target parked vehicle fall into the parking space simulation area, then the target parked vehicle is determined to be a temporary parking vehicle.
[0174] If the determination result is that the outline corner of the target parked vehicle falls into the parking space simulation area, then the target parked vehicle is determined to be an abnormally sized vehicle.
[0175] The device also includes:
[0176] The template generation module is used for:
[0177] Control the camera to capture images of the parking space;
[0178] Based on the parking space image and combined with the imaging principle, the minimum parking space imaging size of the actual parking space in the camera imaging plane is obtained;
[0179] The parking space simulation area is constructed according to the minimum parking space imaging size;
[0180] The parking space simulation areas are arranged sequentially to obtain the parking space layout template.
[0181] The parking space determination device provided in this application embodiment can implement all the processes of the above-described parking space determination method embodiment and achieve the same technical effect. To avoid repetition, it will not be described again here.
[0182] Figure 8 This is a structural diagram of a computer device provided in an embodiment of this application. As shown in the figure, the computer device 8 of this embodiment includes: at least one processor 80 ( Figure 8 (Only one is shown in the diagram), memory 81, and computer program 82 stored in said memory 81 and executable on said at least one processor 80, which, when executed, implements the steps in any of the above method embodiments.
[0183] The computer device 8 may be a desktop computer, laptop, handheld computer, or cloud server, etc. The computer device 8 may include, but is not limited to, a processor 80 and a memory 81. Those skilled in the art will understand that... Figure 8This is merely an example of computer device 8 and does not constitute a limitation on computer device 8. It may include more or fewer components than shown, or combine certain components, or different components. For example, the computer device may also include input / output devices, network access devices, buses, etc.
[0184] The processor 80 can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor.
[0185] The memory 81 can be an internal storage unit of the computer device 8, such as a hard disk or RAM. The memory 81 can also be an external storage device of the computer device 8, such as a plug-in hard disk, Smart Media Card (SMC), Secure Digital (SD) card, or Flash Card. Furthermore, the memory 81 can include both internal and external storage units of the computer device 8. The memory 81 is used to store the computer program and other programs and data required by the computer device. The memory 81 can also be used to temporarily store data that has been output or will be output.
[0186] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0187] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0188] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0189] In the embodiments provided in this application, it should be understood that the disclosed apparatus / computer devices and methods can be implemented in other ways. For example, the apparatus / computer device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual couplings or direct couplings or communication connections may be through some interfaces; indirect couplings or communication connections between devices or units may be electrical, mechanical, or other forms.
[0190] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0191] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0192] If the integrated module / unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in the computer-readable medium can be appropriately added or removed according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electrical carrier signals and telecommunication signals.
[0193] The methods described in this application can be implemented in whole or in part by a computer program product. When the computer program product is run on a computer device, the computer device executes the steps in the various method embodiments described above.
[0194] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. A parking space determination method characterized by comprising: include: Acquire a parking image and load a parking space layout template; the parking space layout template contains multiple sequentially arranged parking space simulation areas; The parking space simulation area is constructed based on the minimum parking space imaging size of the actual parking space in the camera imaging plane; the minimum parking space imaging size is determined based on the parking space image captured by the camera and combined with the imaging principle. Determine the first pixel coordinates of each parking space and the second pixel coordinates of the target parked vehicle in the parking image; Based on the parking space layout template, determine the first parking space simulation area in which each first pixel coordinate falls within the parking space layout template, and determine the second parking space simulation area in which the second pixel coordinate falls within the parking space layout template. Based on the regional association between the second parking space simulation area and the first parking space simulation area in the parking space layout template, the target parking space to which the target parked vehicle belongs is determined.
2. The method of claim 1, wherein, Determining the first pixel coordinates of each parking space and the second pixel coordinates of the target parked vehicle in the parking image includes: Identify the first contour pixel of each parking space and the second contour pixel of the target parked vehicle from the parking image; The center pixel coordinates of the parking space are obtained based on the first contour pixel point of each parking space, and the center pixel coordinates of the parking space are determined as the first pixel coordinates. The vehicle center pixel coordinates are obtained based on the second contour pixel points of the target parked vehicle, and the vehicle center pixel coordinates are determined as the second pixel coordinates; or... Extract the center pixel coordinates of the parking space corresponding to each parking space in the parking image from the pre-calibration information of the parking space, and determine the center pixel coordinates of the parking space as the first pixel coordinates; Identify the second contour pixels of the target parked vehicle from the parking image; The vehicle center pixel coordinates are obtained based on the second contour pixel points of the target parked vehicle, and the vehicle center pixel coordinates are determined as the second pixel coordinates.
3. The method of claim 1, wherein, The step of determining the target parking space to which the target parked vehicle belongs based on the regional association between the second parking space simulation area and the first parking space simulation area in the parking space layout template includes: If the simulated area of the second parking space of the target parked vehicle is the same simulated area as the simulated area of the first parking space of the first parking space, the first parking space is determined as the target parking space to which the target parked vehicle belongs.
4. The method of claim 1, wherein, The step of determining the target parking space to which the target parked vehicle belongs based on the regional association between the second parking space simulation area and the first parking space simulation area in the parking space layout template includes: If the simulated area of the first parking space of all parking spaces is not the same simulated area as the simulated area of the second parking space of the target parked vehicle, then at least one second parking space is determined from the different parking spaces where the simulated areas of the first parking space and the simulated areas of the second parking space are adjacent. The target parking space to which the target parked vehicle belongs is determined from at least one of the second parking spaces.
5. The method of claim 4, wherein, Determining the target parking space to which the target parked vehicle belongs from at least one second parking space includes: If there is only one second parking space, then the second parking space is determined as the target parking space to which the target parked vehicle belongs; If there are multiple second parking spaces, the parking space with the closest distance between the first pixel coordinate and the second pixel coordinate is determined as the target parking space to which the target parked vehicle belongs.
6. The method of claim 1, wherein, Also includes: If the simulated first parking space area of all parking spaces is not the same simulated second parking space area of the target parked vehicle, and the simulated second parking space area does not contain any of the simulated first parking space areas, then it is determined whether the outline corner points of the target parked vehicle fall into the simulated parking space area. If the determination result is that none of the outline corner points of the target parked vehicle fall into the parking space simulation area, then the target parked vehicle is determined to be a temporary parking vehicle. If the determination result is that the outline corner of the target parked vehicle falls into the parking space simulation area, then the target parked vehicle is determined to be an abnormally sized vehicle.
7. The method of claim 1, wherein, Also includes: Control the camera to capture images of the parking space; Based on the parking space image and in accordance with the imaging principle, the minimum parking space imaging size in the camera imaging plane is obtained. The parking space simulation area is constructed according to the minimum parking space imaging size; The parking space simulation areas are arranged sequentially to obtain the parking space layout template.
8. A parking space determination apparatus characterized by comprising: include: The first acquisition module is used to acquire parking images and load parking space layout templates; the parking space layout templates contain multiple sequentially arranged parking space simulation areas; The parking space simulation area is constructed based on the minimum parking space imaging size of the actual parking space in the camera imaging plane; the minimum parking space imaging size is determined based on the parking space image captured by the camera and combined with the imaging principle. The second acquisition module is used to determine the first pixel coordinates of each parking space in the parking image and the second pixel coordinates of the target parked vehicle. The region determination module is used to determine, based on the parking space layout template, the first parking space simulation region in which each first pixel coordinate falls within the parking space layout template, and the second parking space simulation region in which the second pixel coordinate falls within the parking space layout template. The parking space determination module is used to determine the target parking space to which the target parked vehicle belongs based on the regional association relationship between the second parking space simulation area and the first parking space simulation area in the parking space layout template.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method as described in any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, the computer program comprising instructions that, when executed by a computer, cause the computer to perform the method of any one of claims 1 to 9. When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1 to 7.