CN113903188A - Parking space detection method, electronic device and computer readable storage medium - Google Patents

Parking space detection method, electronic device and computer readable storage medium Download PDF

Info

Publication number
CN113903188A
CN113903188A CN202110943529.7A CN202110943529A CN113903188A CN 113903188 A CN113903188 A CN 113903188A CN 202110943529 A CN202110943529 A CN 202110943529A CN 113903188 A CN113903188 A CN 113903188A
Authority
CN
China
Prior art keywords
parking space
points
point
image
detected
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110943529.7A
Other languages
Chinese (zh)
Other versions
CN113903188B (en
Inventor
王政军
巫立峰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Dahua Technology Co Ltd
Original Assignee
Zhejiang Dahua Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhejiang Dahua Technology Co Ltd filed Critical Zhejiang Dahua Technology Co Ltd
Priority to CN202110943529.7A priority Critical patent/CN113903188B/en
Publication of CN113903188A publication Critical patent/CN113903188A/en
Application granted granted Critical
Publication of CN113903188B publication Critical patent/CN113903188B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G08SIGNALLING
    • G08GTRAFFIC CONTROL SYSTEMS
    • G08G1/00Traffic control systems for road vehicles
    • G08G1/14Traffic control systems for road vehicles indicating individual free spaces in parking areas

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Traffic Control Systems (AREA)

Abstract

The application provides a parking space detection method, an electronic device and a computer readable storage medium, wherein the parking space detection method comprises the following steps: acquiring a plurality of parking space angular points in an image to be detected, and fitting the parking space angular points into two first straight lines; mapping the two first straight lines into a transmission image by using at least part of parking space angular points to form two parallel and equally spaced second straight lines; determining a conversion relation between an image to be detected and a transmission image based on the position information of at least part of parking space angular points on a first straight line and the position information of at least part of parking space angular points on a second straight line of corresponding points of the transmission image; dividing two second straight lines based on the positions and the intervals of the corresponding points of the parking space angular points forming the same parking space in the image to be detected in the transmission image to obtain parking space information in the transmission image; and obtaining the parking space information in the image to be detected based on the conversion relation and the parking space information in the transmission diagram. Through the arrangement, the false detection parking spaces are corrected, and the missed detection parking spaces are complemented.

Description

Parking space detection method, electronic device and computer readable storage medium
Technical Field
The invention relates to the technical field of parking space detection, in particular to a parking space detection method, electronic equipment and a computer readable storage medium.
Background
With the development of society, the number of motor vehicles is increased dramatically, which causes more common social problems: parking is difficult, and a driver cannot know where the surrounding parking spaces are left; the parking is not standard, and the driver directly parks the vehicle in the non-parking area. Therefore, the parking space area can be quickly and accurately positioned, and whether the parking space is vacant or not can be determined, so that the vacant parking space information can be issued to the driver, and the guarantee is provided for urban traffic management and construction.
In a roadside parking scene, the conventional parking space detection method still generates certain false detection and missed detection due to the shielding of a vehicle and the like, and cannot provide accurate parking space information for a driver.
Disclosure of Invention
In view of this, the present application provides a parking space detection method, an electronic device and a computer-readable storage medium, so as to solve the technical problems of false detection and missed detection caused by the shielding of a vehicle in the prior art.
In order to solve the above technical problem, a first technical solution provided by the present application is: the parking space detection method comprises the following steps: acquiring a plurality of parking space angular points in an image to be detected, and fitting the parking space angular points into two first straight lines;
mapping the two first straight lines into a transmission diagram by using at least part of the parking space angle points to form two parallel and equally spaced second straight lines;
determining a conversion relation between the image to be detected and the transmission image based on the position information of at least part of the parking space angular points on the first straight line and the position information of at least part of the parking space angular points on the second straight line of corresponding points of the transmission image; and
dividing the two second lines based on the positions and the distances of corresponding points of the parking space angular points forming the same parking space in the to-be-detected image in the transmission map to obtain parking space information in the transmission map;
and obtaining the parking space information in the image to be detected based on the conversion relation and the parking space information in the transmission diagram.
Wherein, the mapping the two first straight lines into the transmission diagram by using at least part of the parking space angle points to form two parallel and equally spaced second straight lines comprises:
selecting a set number of target parking space angular points from the plurality of parking space angular points;
and mapping the target parking space angle points to the transmission map so that connecting lines of corresponding points of the target parking space angle points in the transmission map form two parallel and equally-spaced second straight lines.
Wherein, from select the target parking stall angular point of setting for quantity in a plurality of parking stall angular points, include:
respectively acquiring the distance from each parking space angular point to two first straight lines;
and determining the parking space angle points with the minimum distance to the two first straight lines and the set number as the target parking space angle points.
Wherein, it includes to acquire respectively every parking stall angle point reaches two the distance of first straight line:
respectively acquiring the position coordinates of each parking space angular point in a set coordinate system; the set coordinate system is established by taking a parking space angular point at an end point in the image to be detected as an original point and taking two directions extending along a parking space as coordinate axes;
and calculating the distance from each parking space angular point to the two first straight lines by using the position coordinates.
Wherein, the determining the conversion relationship between the image to be detected and the transmission map based on the position information of the at least part of the parking space angle points on the first straight line and the position information of the at least part of the parking space angle points on the second straight line of the corresponding points of the transmission map comprises:
acquiring a first position coordinate of the target parking space angular point in the image to be detected and a second position coordinate of the corresponding point of the target parking space angular point in the transmission image;
and obtaining the conversion relation between the image to be detected and the transmission image by using the first position coordinate and the second position coordinate.
Wherein, based on waiting to examine the parking stall angular point who constitutes same parking stall in the detected image and being in the position and the interval of the corresponding point in the transmission map are right two second straight lines divide, obtain parking stall information in the transmission map includes:
acquiring the distance between two corresponding points of two corner points in the transmission image, wherein the two corner points form the same parking space in the image to be detected;
and dividing the two second straight lines at intervals to form a plurality of parking spaces, so as to obtain parking space information in the transmission diagram.
Wherein, every interval divides the two second straight lines to form a plurality of parking spaces, thereby obtaining the parking space information in the transmission diagram, including
And in response to that the remaining distance between the head end and the tail end of the two second straight lines is smaller than the distance and larger than half of the distance, dividing an area of the distance, in which the remaining distance is smaller than the distance and larger than half of the distance, into a parking space.
Wherein, based on the conversion relation and the parking stall information in the transmission chart obtains waiting to detect the parking stall information in the image, include:
and mapping the corresponding points of the plurality of parking spaces in the transmission diagram to the two first straight lines by using a conversion relation to obtain the parking space information of the image to be detected.
Wherein the set number is at least 4.
In order to solve the above technical problem, a second technical solution provided by the present application is: provided is an electronic device including: the parking space detection device comprises a memory and a processor, wherein the memory stores program instructions, and the processor calls the program instructions from the memory to execute any one of the parking space detection methods.
In order to solve the above technical problem, a third technical solution provided by the present application is: there is provided a computer readable storage medium storing a program file executable to implement any one of the above-described parking space detection methods.
The beneficial effect of this application: be different from prior art, parking stall detection method in this application includes: acquiring a plurality of parking space angular points in an image to be detected, and fitting the parking space angular points into two first straight lines; mapping the two first straight lines into a transmission image by using at least part of parking space angular points to form two parallel and equally spaced second straight lines; determining a conversion relation between an image to be detected and a transmission image based on the position information of at least part of parking space angular points on a first straight line and the position information of at least part of parking space angular points on a second straight line of corresponding points of the transmission image; dividing two second straight lines based on the positions and the intervals of the corresponding points of the parking space angular points forming the same parking space in the image to be detected in the transmission image to obtain parking space information in the transmission image; and obtaining the parking space information in the image to be detected based on the conversion relation and the parking space information in the transmission diagram. Through the arrangement, after partial parking spaces are detected out through the parking space angular points, the false detection parking spaces are corrected, and the missed detection parking spaces are complemented, so that accurate parking space information is provided for a driver, and the driver can find the parking spaces more quickly.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a diagram of an ideal parking space detection effect of a parking space based on a parking space angular point;
FIG. 2 is a diagram of a parking space detection effect under the actual situation of detecting a parking space based on a parking space angular point;
FIG. 3 is a diagram of another parking space detection effect in the actual situation of detecting a parking space based on a parking space angular point;
fig. 4 is a schematic flow chart of a parking space detection method provided in the embodiment of the present application;
fig. 5 is a schematic diagram of detecting a parking space corner point in step S11 provided in fig. 4;
FIG. 6 is a schematic diagram corresponding to step S11 provided in FIG. 4;
fig. 7 is a schematic flowchart of a specific embodiment of step S12 in the parking space detection method provided in fig. 4;
fig. 8 is a schematic diagram of a specific embodiment of determining a target parking stall corner point in step S121 provided in fig. 7;
FIG. 9 is a schematic diagram corresponding to step S122 provided in FIG. 7;
FIG. 10 is a diagrammatic view of the target vehicle corner point of FIG. 8 at the corresponding point in the transmission map;
fig. 11 is a schematic flow chart of a specific embodiment of a parking space detection method provided in the present application;
fig. 12 is a schematic structural diagram of an electronic device provided in an embodiment of the present application;
fig. 13 is a schematic structural diagram of a computer-readable storage medium provided in an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The terms "first", "second" and "third" in this application are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implying any indication of the number of technical features indicated. Thus, a feature defined as "first," "second," or "third" may explicitly or implicitly include at least one of the feature. In the description of the present application, "plurality" means at least two, e.g., two, three, etc., unless explicitly specifically limited otherwise. All directional indications (such as up, down, left, right, front, and rear … …) in the embodiments of the present application are only used to explain the relative positional relationship between the components, the movement, and the like in a specific posture (as shown in the drawings), and if the specific posture is changed, the directional indication is changed accordingly. Furthermore, the terms "include" and "have," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements listed, but may alternatively include other steps or elements not listed, or inherent to such process, method, article, or apparatus.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein can be combined with other embodiments.
Currently, in a roadside parking scene, the parking spaces are mostly manually defined, and the labor cost is high. In the detection process of the roadside scene by using the parking space detection method based on the parking space angular point detection, the parking space detection effect under the ideal condition is shown in fig. 1 (fig. 1 is a parking space detection effect diagram of a parking space under the ideal condition based on the parking space angular point detection), and the actual parking space detection effect with the vehicle shielding or the far parking space detection effect is relatively non-shielding or the near parking space detection effect is worse, for example, the missing detection occurs (see fig. 2, fig. 2 is a parking space detection effect diagram under the actual condition of the parking space based on the parking space angular point detection), or the missing detection and the incomplete detection occur simultaneously (see fig. 3, fig. 3 is another parking space detection effect diagram under the actual condition of the parking space based on the parking space angular point detection), and technical personnel in the field can understand that the problem that the detection network cannot be basically as shown in fig. 2 and fig. 3 by lifting can be solved. That is to say, the parking space detection method based on the parking space angular point detection may generate certain false detection and missed detection due to the shielding of the vehicle and other situations, and requires the engineering configuration personnel to continue manual adjustment.
In the related art, there is also a method for detecting a road test parking space, including: the method comprises the steps of obtaining image data collected by a camera, converting the image data into a top view, extracting a plurality of detection frames from the top view, and tracking the detection frames by adopting a plurality of two-dimensional Kalman filters to determine real detection frames. Then, judging a parking space entry point based on the distance between the central points of the real detection frames, and determining the position coordinates of the parking space based on the parking space entry point; and finally, judging whether the parking space is occupied or not based on the position coordinates of the parking space. The detection method has the main defects that the method cannot be applied to a common monitoring camera, roadside parking is characterized by dispersion and large quantity, the parameters of each camera are acquired for perspective transformation, the transformation of a common image into a top view is difficult to a certain degree, information is changed after the perspective transformation of a video frame of the common camera, and when factors such as shielding exist on a target, the detection effect is relatively poor; and the detection method also needs to use tracking, and the method is complex.
Based on the problems, the parking space detection method is applied to roadside parking scenes, the problems of false detection and missed detection in parking space detection are solved, and the implementation process is simple.
Referring to fig. 4, fig. 4 is a schematic flow chart of a parking space detection method according to an embodiment of the present application.
The embodiment of the application provides a parking space detection method, which comprises the following steps.
S11: and acquiring a plurality of parking space angular points in the image to be detected, and fitting the parking space angular points into two first straight lines.
Specifically, an image to be detected is obtained through an image acquisition device, a plurality of parking spaces are arranged in the image to be detected, and an angular point of each parking space in the plurality of parking spaces is detected through a detection method for detecting key points through a neural network, so that a plurality of angular points of the parking spaces are obtained. Wherein, the parking stall angular point is for forming the point on this parking stall sideline. Because drive test parking stall, a plurality of parking stalls are arranged in proper order along the extending direction on way and are set up, can obtain two first lines with the fitting of a plurality of parking stall angular points.
In an embodiment, four vertexes of each of the multiple parking spaces are detected by a method for detecting key points through a neural network, where the four vertexes are an upper left angular point, a lower left angular point, an upper right angular point, and a lower right angular point, respectively (as shown in fig. 5, fig. 5 is a schematic diagram of detecting parking space angular points in step S11 provided in fig. 4); fitting the plurality of upper left corner points and the plurality of lower left corner points according to the arrangement sequence of the plurality of parking spaces to obtain a first straight line, and fitting the plurality of upper right corner points and the plurality of lower right corner points according to the arrangement sequence of the plurality of parking spaces to obtain another first straight line (as shown in fig. 6, fig. 6 is a schematic diagram corresponding to the step S11 provided in fig. 4). In other embodiments, other points other than the vertex on the parking space edge line may be detected as the parking space corner points, and the design is specifically performed as required. It can be understood that the two first lines obtained by fitting are not parallel due to factors such as the viewing angle in the image to be detected.
S12: and mapping the two first straight lines into the transmission image by utilizing at least part of parking space angular points to form two parallel and equally-spaced second straight lines.
Specifically, please refer to fig. 7, fig. 7 is a flowchart illustrating an embodiment of step S12 in the parking space detection method provided in fig. 4. Step S12 specifically includes the following steps:
s121: and selecting a set number of target parking space angle points from the plurality of parking space angle points.
Specifically, the set number is at least 4.
In one embodiment, the distances from each parking space angular point to the two first lines are respectively acquired, and the parking space angular points with the set number and the minimum distances from the two first lines are determined as the target parking space angular points. The step of respectively obtaining the distances from each parking space corner point to the two first straight lines specifically comprises the following steps: respectively acquiring the position coordinates of each parking space angular point in a set coordinate system; and calculating the distance from each parking space angular point to the two first straight lines by using the position coordinates. The set coordinate system is established by taking a parking space angular point at an end point in an image to be detected as an original point and taking two directions extending along a parking space as coordinate axes. The parking space angular point is the vertex of the parking space.
And a coordinate system is set, so that the distance from the parking space corner point to the first straight line can be calculated conveniently. It can be understood that, in the set coordinate system, the direction in which the parking space and the road extend may be taken as the Y axis, and the other extending direction of the parking space may be taken as the X axis; the same direction of the parking space and the extending direction of the road can be used as an X axis, the other extending direction of the parking space is used as a Y axis, the distance from the corner point of the parking space to the first straight line can be calculated, and the X axis and the Y axis of the set coordinate system are not limited in the application.
Specifically, the target parking space angle point may be determined by the following formula.
Figure BDA0003216027750000071
Among them, AdisiIndicating the distance, Bdis, of the corner point of the parking space from the first straight lineiThe distance between the parking space angle points and the second first straight line is represented, and Dis _ sum represents that the sum of the distances between the parking space angle points with the set number and the two first straight lines is the minimum, wherein the set number is 4. Referring to fig. 8, fig. 8 is a simplified diagram of an embodiment of determining a target parking space corner point in step S121 provided in fig. 7. For example, a first point a and a second point B are selected on the first straight line L1, a third point C and a fourth point D are selected on the second first straight line L2, and when the sum of the distance from the first point a to the second first straight line L2, the distance from the second point B to the second first straight line L2, the distance from the third point C to the first straight line L1, and the distance from the fourth point D to the first straight line L1 is minimum, the first point a, the second point B, the third point C, and the fourth point D are determined as the target parking space corner points. At this time, the distance between the first point a and the second point B is approximately equal to the distance between the third point C and the fourth point D; and the distance between the first point a and the third point C is approximately equal to the distance between the second point B and the fourth point D. In this embodiment, the first point a, the second point B, the third point C, and the fourth point D are respectively vertexes of the parking space, which may be respectively an upper left angular point, a lower left angular point, an upper right angular point, and a lower right angular point of the parking space, and the parking space surrounded by the first point a, the second point B, the third point C, and the fourth point D is a target parking space. It will be appreciated that the first point a and the second point B are adjacent on a first line L1, and the third point C and the fourth point D are adjacent on a second first line L2. The first point a, the second point B, the third point C and the fourth point D may constitute the same parking space, which is a target parking space. By setting a coordinate system, the position coordinates exist only in the first point A, the second point B, the third point C and the fourth point D, and the distance from the first point A to the second first straight line L2 can be calculatedFrom the second point B to the second first line L2, from the third point C to the first line L1 and from the fourth point D to the first line L1.
Further, a head end point E and a tail end point F are selected from the first straight line L1, a head end point G and a tail end point H are selected from the second straight line L2, and the head end point E, the tail end point F, the head end point G, and the tail end point H are also determined as target parking space corner points. And determining the position coordinates of the head end point E, the tail end point F, the head end point G and the tail end point H through a coordinate system. In this embodiment, the head point E may be an upper left corner point of the parking space at the head end of the first straight line, the head point G may be an upper right corner point of the parking space at the head end of the first straight line, the tail point F may be a lower left corner point of the parking space at the tail end of the first straight line, and the tail point H may be a lower right corner point of the parking space at the tail end of the first straight line.
In another embodiment, the plurality of parking space angular points are other points on the parking space edge line other than the vertex (the vertex of the non-parking space and the end point of the first straight line), and a set number of parking space angular points are selected from the plurality of parking space angular points as the target parking space angular points. For example, two parking space angle points are selected on a first straight line, and the distance between the two parking space angle points is determined to be a first value according to a set coordinate system; two parking space angle points with the first distance are selected on the second straight line (the distance between the two parking space angle points selected on the second straight line is determined according to a set coordinate system), and the four parking space angle points are determined as target parking space angle points.
S122: and mapping the target parking space angle points to the transmission map so that connecting lines of corresponding points of the target parking space angle points in the transmission map form two parallel second straight lines at equal intervals.
The target parking space corner point is mapped to the perspective view to obtain two second straight lines as shown in fig. 9, and fig. 9 is a schematic diagram corresponding to step S122 provided in fig. 7.
In one embodiment, the parking space angle points with the set number, which are the smallest sum of the distances from each parking space angle point to the two first lines, are determined as the target parking space angle points. The parking space formed by the target parking space angle points determined by the method is close to a real parking space, namely, the parking space formed by the target parking space angle points is close to a rectangle. The target parking space angle point is mapped to the transmission map, and a connecting line of corresponding points of the target parking space angle point in the transmission map forms two parallel and equally-spaced second straight lines (please refer to fig. 10, fig. 10 is a diagram of corresponding points of the target parking space angle point in the transmission map in fig. 8). Wherein, a corresponding point of the first point a in the transmission diagram is a1, a corresponding point of the second point B in the transmission diagram is B1, a corresponding point of the third point C in the transmission diagram is C1, a corresponding point of the fourth point D in the transmission diagram is D1, a corresponding point of the head end point E in the transmission diagram is E1, a corresponding point of the tail end point F in the transmission diagram is F1, a corresponding point of the head end point G in the transmission diagram is G1, and a corresponding point of the tail end point H in the transmission diagram is H1, a connecting line of the corresponding point E1, the corresponding point a1, the corresponding point B1 and the corresponding point F1 forms a first second straight line L3, a connecting line of the corresponding point G1, the corresponding point C1, the corresponding point D1 and the tail end point H1 forms a second straight line L4, and the first second straight line L3 and the second straight line L4 are parallel and equidistant.
It can be understood that if the target parking space angular point is only the first point a, the second point B, the third point C and the fourth point D, two parallel and equidistant second straight lines can be obtained according to the target parking space angular point, and the two second straight lines at the moment are extended in the same length along the extending direction of the second straight lines, so that the second straight lines can be divided subsequently. If the target parking space angular point only comprises a head end point E, a tail end point F, a head end point G and a tail end point H, two parallel and equidistant second straight lines can be obtained according to the target parking space angular point; before the subsequent second straight line is divided, a first point A, a second point B, a third point C and a fourth point D need to be determined through the formula so as to obtain information of the same parking space where the first point A, the second point B, the third point C and the fourth point D are located, the same parking space is used as a target parking space, and the second straight line is divided according to the distance between the target parking spaces.
In another embodiment, a set number of parking space corner points are selected as target parking space corner points at non-vertices on a plurality of parking space side lines. For example, two parking space angle points are selected on a first straight line, and the distance between the two parking space angle points is determined to be a first value according to a set coordinate system; two parking space angle points with the first distance are selected on the second straight line (the distance between the two parking space angle points selected on the second straight line is determined according to a set coordinate system), and the four parking space angle points are determined as target parking space angle points. The target parking space angular points determined by the method are equidistant on two first straight lines, and two side lines of the actual parking spaces are parallel, so that the connecting lines of the corresponding points of the target parking space angular points in the transmission diagram form two parallel and equidistant second straight lines. It can be understood that the two second straight lines obtained in this embodiment need to be extended along the extending direction by the same length, so as to divide the second straight lines in the following process.
S13: and determining the image to be detected and the conversion relation of the transmission diagram based on the position information of at least part of the parking space angle points on the first straight line and the position information of at least part of the parking space angle points on the corresponding points of the transmission diagram on the second straight line.
Specifically, at least part of the parking space angular points are target parking space angular points, and a first position coordinate of the target parking space angular points in the image to be detected and a second position coordinate of corresponding points of the target parking space angular points in the transmission image are obtained; and obtaining the conversion relation between the image to be detected and the transmission image by utilizing the first position coordinate and the second position coordinate. Specifically, a coordinate system is set in an image to be detected, and a first position coordinate of a target parking space corner point in the image to be detected is determined by utilizing the coordinate system; setting another coordinate system in the transmission image, and determining a second position coordinate of a corresponding point of the target parking space corner point in the transmission image by using the coordinate system; and obtaining the conversion relation between the image to be detected and the transmission image by utilizing the first position coordinate and the second position coordinate. For example, a transformation matrix for converting the image to be detected into the transmission map is obtained by using the first position coordinate and the second position coordinate.
S14: and dividing the two second straight lines based on the positions and the intervals of the corresponding points of the parking space angular points forming the same parking space in the image to be detected in the transmission map to obtain the parking space information in the transmission map.
Specifically, the distance between two corresponding points of two corner points in a transmission image, wherein the two corner points form the same parking space in an image to be detected, is obtained; and dividing the two second straight lines at intervals to form a plurality of parking spaces, so as to obtain parking space information in the transmission diagram. The coordinate system is set in the transmission diagram to obtain the distance between two corresponding points of two corner points in the transmission diagram, wherein the two corner points form the same parking space in the image to be detected, and each distance in the coordinate system is divided into a parking space, so that the parking space information in the transmission diagram is obtained.
In one embodiment, two angular points of the parking space angular points forming the same parking space in the image to be detected are selected, wherein the two angular points can be the vertexes of the parking space, such as an upper left angular point and a lower left angular point; and acquiring the distance between two corresponding points of the two angular points in the transmission image, and dividing a parking space on the second straight line at intervals of the distance. That is, the interval between the corresponding point a1 and the corresponding point B1 in fig. 4, or the interval between the corresponding point C1 and the corresponding point D1 is acquired, and the second straight line is divided according to the interval. The distance between the corresponding point a1 and the corresponding point B1 is the height of one space in the perspective view, and in reality, the heights of a plurality of spaces are the same, so that the spaces can be divided according to the distance.
In another embodiment, two angular points of the parking space angular points forming the same parking space in the image to be detected are selected, wherein the two angular points can be the vertexes of the parking space, such as an upper left angular point and a lower right angular point; two corresponding points of the two angular points in the transmission diagram are respectively located on two second straight lines, the distance between the two corresponding points of the two angular points in the transmission diagram is obtained, and along the extending direction of the second straight lines, a parking space is defined on the two second straight lines at intervals of the distance. That is, the distance between the corresponding point a1 and the corresponding point D1 in fig. 4, or the distance between the corresponding point B1 and the corresponding point C1, that is, the distance of the diagonal of the parking space is obtained, and the second straight line is divided according to the distance. The distance between the corresponding point a1 and the corresponding point D1 is the length of a diagonal line of one space in the perspective view, and in reality, the lengths of the diagonal lines of a plurality of spaces are the same, so that the spaces can be divided according to the distance.
Two corresponding points of two corner points in the transmission image, which form the corner points of the same parking space and are selected from the images to be detected, may be at the end of the second straight line or at the middle position of the second straight line (the middle position of the second straight line refers to the rest part except the end of the second straight line). When two corresponding points of two corner points in the transmission image, which are selected from the images to be detected and form the same parking space, in the parking space corner points are located at the middle position of a second straight line, and a parking space is defined from the middle position of the second straight line to two ends of the second straight line at intervals; and in response to the fact that the remaining distance between the head end and the tail end of the two second straight lines is smaller than the distance and larger than half of the distance, a parking space is defined. That is to say, divide two second straight lines at this interval to form a plurality of parking stalls, thereby obtain the parking stall information in the transmission map, include: and in response to the fact that the remaining distance between the head end and the tail end of the two second straight lines is smaller than the distance and larger than a half of the distance, dividing the area of which the remaining distance is smaller than the distance and larger than the half of the distance into a parking space.
It should be understood that the order of performing steps S13 and S14 is not limited, and step S13 may be performed first, step S14 may be performed first, step S14 may be performed first, step S13 may be performed, step S13 and step S14 may be performed simultaneously, and the steps may be designed as needed.
S15: and obtaining parking space information in the image to be detected based on the conversion relation and the parking space information in the transmission diagram.
Specifically, the corresponding points of the multiple parking spaces in the transmission diagram are mapped to two first straight lines by using the conversion relationship, so that the parking space information of the image to be detected is obtained. The method comprises the steps of dividing a perspective view into a plurality of parking spaces, correspondingly obtaining corresponding points of the plurality of parking spaces in the perspective view, mapping the corresponding points of the plurality of parking spaces to two first straight lines by using a conversion relation, and obtaining parking space information of an image to be detected. In an embodiment, when the conversion relationship from the image to be detected to the transmission map is specifically a transformation matrix, the conversion relationship from the transmission map to the image to be detected is specifically an inverse transformation matrix. That is, the conversion manner of the transmission map into the image to be detected and the conversion manner of the image to be detected into the transmission map are in reverse correspondence.
The parking space detection method comprises the steps of obtaining a plurality of parking space angular points in an image to be detected, and fitting the parking space angular points into two first straight lines; mapping the two first straight lines into a transmission image by using at least part of parking space angular points to form two parallel and equally spaced second straight lines; determining a conversion relation between an image to be detected and a transmission image based on the position information of at least part of parking space angular points on a first straight line and the position information of at least part of parking space angular points on a second straight line of corresponding points of the transmission image; dividing two second straight lines based on the positions and the intervals of the corresponding points of the parking space angular points forming the same parking space in the image to be detected in the transmission image to obtain parking space information in the transmission image; the parking space information in the image to be detected is obtained based on the conversion relation and the parking space information in the transmission image, after partial parking spaces are detected out through the parking space angular points, the purpose of correcting the false detection parking spaces and supplementing the missed detection parking spaces is achieved, accurate parking space information is provided for a driver, and the driver can find the parking spaces more quickly. In addition, the parking space detection method does not need to acquire camera parameters (internal reference and external reference), and does not need to convert the image to be detected into a top view, so that the realization difficulty of the detection method is reduced.
Referring to fig. 11, fig. 11 is a schematic flow chart of an embodiment of a parking space detection method provided in the present application.
S21: and acquiring the detection information of all parking space angular points. The image to be detected is obtained through the image acquisition device, a plurality of parking spaces are arranged in the image to be detected, four vertexes of each parking space in the plurality of parking spaces are detected through the detection method of the neural network detection key points, and the four vertexes are respectively an upper left angular point, a lower left angular point, an upper right angular point and a lower right angular point, as shown in fig. 5.
S22: and sequencing all the parking spaces. And setting a coordinate system by taking a parking space angular point at an end point in the image to be detected as an original point, taking the same direction of the parking space and the extending direction of the road as a Y axis and taking the other extending direction of the parking space as an X axis. And sequencing all parking spaces along the Y axis of the coordinate system from small to large according to the coordinates of the upper left corner points, so that the target parking space corner points for perspective transformation can be conveniently selected.
S23: fitting the upper left angular points and the lower left angular points of all the parking spaces to obtain a first straight line, and fitting the upper right angular points and the lower right angular points of all the parking spaces to obtain a second first straight line, as shown in fig. 6.
S24: and acquiring head and tail end points of the two first lines and an upper left angular point, a lower left angular point, an upper right angular point and a lower right angular point of the target parking space (as shown in fig. 8). The maximum point and the minimum point of the first straight line on the Y axis of the set coordinate system are set as the head and tail end points. The head end point of the first straight line is the minimum y value in the parking space angle points of the first parking space after sequencing, and the tail end point is the maximum y value in the parking space angle points of the last parking space after sequencing. And acquiring an upper left angular point, a lower left angular point, an upper right angular point and a lower right angular point of the target parking space through the following formula. This formula is described above and will not be described further.
Figure BDA0003216027750000131
S25: and obtaining a transformation matrix by using the upper left angular point, the lower left angular point, the upper right angular point and the lower right angular point of the target parking space as four points of perspective transformation. Determining first position coordinates of an upper left angular point, a lower left angular point, an upper right angular point and a lower right angular point of a target parking space in an image to be detected by using a coordinate system in the image to be detected; setting another coordinate system in the transmission image, and determining second position coordinates of corresponding points of an upper left angular point, a lower left angular point, an upper right angular point and a lower right angular point of the target parking space in the transmission image by using the coordinate system; and obtaining a transformation matrix by using the first position coordinate and the second position coordinate.
S26: and mapping head and tail end points of the two first straight lines into the perspective view by using a transformation matrix to obtain two parallel and equally-spaced second straight lines in the perspective view (as shown in FIG. 10).
S27: and dividing the two second straight lines according to the height of the target parking space in the perspective view to obtain the parking space angle point information of all parking spaces in the perspective view. Referring to fig. 10, the spacing between corresponding point a1 and corresponding point B1 is the height of the target space relative to the space in the perspective view. The manner of dividing the two second straight lines is the same as the above description, and is not described again.
S28: and mapping the parking space angular point information in the perspective view back to the image to be detected by using an inverse transformation matrix which is in a reverse corresponding relation with the transformation matrix to obtain the parking space information in the image to be detected.
The parking space detection method can correct the false detection parking space and complement the missed detection parking space so as to provide accurate parking space information for the driver, and the driver can find the parking space more quickly. In addition, the parking space detection method does not need to acquire camera parameters (internal reference and external reference), and does not need to convert the image to be detected into a top view, so that the realization difficulty of the detection method is reduced.
Referring to fig. 12, fig. 12 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure. The electronic device comprises a memory 20 and a processor 21 connected to each other.
The memory 20 is used for storing program instructions for implementing any one of the above-mentioned parking space detection methods.
Processor 21 is operative to execute program instructions stored in memory 20; that is, the processor 21 retrieves the program instructions stored in the memory 20 from the memory 20 to execute any one of the above-mentioned parking space detection methods.
The processor 21 may also be referred to as a CPU (Central Processing Unit). The processor 21 may be an integrated circuit chip having signal processing capabilities. The processor 21 may also be a general purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The storage 20 may be a memory bank, a TF card, etc., and may store all information in the electronic device of the device, including the input raw data, the computer program, the intermediate operation result, and the final operation result. It stores and retrieves information based on the location specified by the controller. With the memory 20, the electronic device can only have a memory function to ensure normal operation. The storage 20 of the electronic device may be classified into a main storage (internal storage) and an auxiliary storage (external storage) according to the purpose, and there is a classification method into an external storage and an internal storage. The external memory is usually a magnetic medium, an optical disk, or the like, and can store information for a long period of time. The memory refers to a storage component on the main board, which is used for storing data and programs currently being executed, but is only used for temporarily storing the programs and the data, and the data is lost when the power is turned off or the power is cut off.
In the several embodiments provided in the present application, it should be understood that the disclosed method and apparatus may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, a division of a module or a unit is merely a logical division, and an actual implementation may have another division, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
Units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a system server, a network device, or the like) or a processor (processor) to execute all or part of the steps of the method of the embodiments of the present application.
Referring to fig. 13, fig. 13 is a schematic structural diagram of a computer-readable storage medium according to an embodiment of the present disclosure. The storage medium of the present application stores a program file 30 capable of implementing all the above parking space detection methods, where the program file 30 may be stored in the storage medium in the form of a software product, and includes several instructions to enable a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor (processor) to execute all or part of the steps of the methods according to the embodiments of the present application. The aforementioned storage device includes: various media capable of storing program codes, such as a usb disk, a mobile hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, or terminal devices, such as a computer, a server, a mobile phone, and a tablet.
The above description is only for the purpose of illustrating embodiments of the present application and is not intended to limit the scope of the present application, and all modifications of equivalent structures and equivalent processes, which are made by the contents of the specification and the drawings of the present application or are directly or indirectly applied to other related technical fields, are also included in the scope of the present application.

Claims (11)

1. A parking space detection method is characterized by comprising the following steps:
acquiring a plurality of parking space angular points in an image to be detected, and fitting the parking space angular points into two first straight lines;
mapping the two first straight lines into a transmission diagram by using at least part of the parking space angle points to form two parallel and equally spaced second straight lines;
determining a conversion relation between the image to be detected and the transmission image based on the position information of at least part of the parking space angular points on the first straight line and the position information of at least part of the parking space angular points on the second straight line of corresponding points of the transmission image; and
dividing the two second lines based on the positions and the distances of corresponding points of the parking space angular points forming the same parking space in the to-be-detected image in the transmission map to obtain parking space information in the transmission map;
and obtaining the parking space information in the image to be detected based on the conversion relation and the parking space information in the transmission diagram.
2. The parking space detection method according to claim 1, wherein the mapping the two first straight lines into a transmission map by using at least part of the parking space angle points to form two parallel and equally spaced second straight lines comprises:
selecting a set number of target parking space angular points from the plurality of parking space angular points;
and mapping the target parking space angle points to the transmission map so that connecting lines of corresponding points of the target parking space angle points in the transmission map form two parallel and equally-spaced second straight lines.
3. The parking space detection method according to claim 2, wherein the selecting a set number of target parking space angle points from the plurality of parking space angle points comprises:
respectively acquiring the distance from each parking space angular point to two first straight lines;
and determining the parking space angle points with the minimum distance to the two first straight lines and the set number as the target parking space angle points.
4. The parking space detection method according to claim 3, wherein the step of respectively obtaining the distance from each parking space corner point to the two first lines comprises:
respectively acquiring the position coordinates of each parking space angular point in a set coordinate system; the set coordinate system is established by taking a parking space angular point at an end point in the image to be detected as an original point and taking two directions extending along a parking space as coordinate axes;
and calculating the distance from each parking space angular point to the two first straight lines by using the position coordinates.
5. The parking space detection method according to any one of claims 2 to 4, wherein the determining of the conversion relationship between the image to be detected and the transmission map based on the position information of at least some of the parking space angle points on the first line and the position information of at least some of the parking space angle points on the second line of the corresponding points of the transmission map comprises:
acquiring a first position coordinate of the target parking space angular point in the image to be detected and a second position coordinate of the corresponding point of the target parking space angular point in the transmission image;
and obtaining the conversion relation between the image to be detected and the transmission image by using the first position coordinate and the second position coordinate.
6. The parking space detection method according to any one of claims 2 to 4, wherein the step of dividing the two second lines based on the positions and the distances of the corresponding points in the transmission map of the parking space corner points forming the same parking space in the image to be detected to obtain the parking space information in the transmission map comprises the steps of:
acquiring the distance between two corresponding points of two corner points in the transmission image, wherein the two corner points form the same parking space in the image to be detected;
and dividing the two second straight lines at intervals to form a plurality of parking spaces, so as to obtain parking space information in the transmission diagram.
7. The parking space detection method according to claim 6, wherein the dividing the two second straight lines every interval of the distance to form a plurality of parking spaces so as to obtain the parking space information in the transmission map comprises:
and in response to that the remaining distance between the head end and the tail end of the two second straight lines is smaller than the distance and larger than half of the distance, dividing an area of the distance, in which the remaining distance is smaller than the distance and larger than half of the distance, into a parking space.
8. The parking space detection method according to claim 1, wherein the obtaining of the parking space information in the image to be detected based on the conversion relationship and the parking space information in the transmission map comprises:
and mapping the corresponding points of the plurality of parking spaces in the transmission diagram to the two first straight lines by using a conversion relation to obtain the parking space information of the image to be detected.
9. A space detection method according to claim 2 or 3, wherein the set number is at least 4.
10. An electronic device, comprising: a memory storing program instructions and a processor retrieving the program instructions from the memory to perform the method of any one of claims 1 to 9.
11. A computer-readable storage medium, characterized in that a program file is stored, which can be executed to implement the parking space detection method according to any one of claims 1-9.
CN202110943529.7A 2021-08-17 2021-08-17 Parking space detection method, electronic device and computer readable storage medium Active CN113903188B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110943529.7A CN113903188B (en) 2021-08-17 2021-08-17 Parking space detection method, electronic device and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110943529.7A CN113903188B (en) 2021-08-17 2021-08-17 Parking space detection method, electronic device and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN113903188A true CN113903188A (en) 2022-01-07
CN113903188B CN113903188B (en) 2022-12-06

Family

ID=79187602

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110943529.7A Active CN113903188B (en) 2021-08-17 2021-08-17 Parking space detection method, electronic device and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN113903188B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115206130A (en) * 2022-07-12 2022-10-18 合众新能源汽车有限公司 Parking space detection method, system, terminal and storage medium

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2018116431A (en) * 2017-01-17 2018-07-26 株式会社デンソーテン Division line detection device, division line detection system, and division line detection method
US20190094871A1 (en) * 2017-09-28 2019-03-28 Toyota Jidosha Kabushiki Kaisha Driving support apparatus
CN109614913A (en) * 2018-12-05 2019-04-12 北京纵目安驰智能科技有限公司 A kind of oblique parking stall recognition methods, device and storage medium
KR101993378B1 (en) * 2018-03-12 2019-06-26 에이치디씨아이콘트롤스주식회사 System and method for detecting and guiding parking availability using image information
CN110390306A (en) * 2019-07-25 2019-10-29 湖州宏威新能源汽车有限公司 Detection method, vehicle and the computer readable storage medium of right angle parking stall
CN110414355A (en) * 2019-06-27 2019-11-05 沈阳工业大学 The right bit sky parking stall of view-based access control model and parking stall line detecting method during parking
CN110472580A (en) * 2019-08-16 2019-11-19 北京茵沃汽车科技有限公司 The method, apparatus of detection parking stall based on full-view image, storage medium
CN110796063A (en) * 2019-10-24 2020-02-14 百度在线网络技术(北京)有限公司 Method, device, equipment, storage medium and vehicle for detecting parking space
CN111178295A (en) * 2019-12-31 2020-05-19 华为技术有限公司 Parking space detection and model training method and device, vehicle, equipment and storage medium
WO2020238284A1 (en) * 2019-05-29 2020-12-03 北京市商汤科技开发有限公司 Parking space detection method and apparatus, and electronic device
CN112562400A (en) * 2020-12-24 2021-03-26 北京筑梦园科技有限公司 Parking space line acquisition method and device and parking management system
CN112633152A (en) * 2020-12-22 2021-04-09 深圳佑驾创新科技有限公司 Parking space detection method and device, computer equipment and storage medium

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2018116431A (en) * 2017-01-17 2018-07-26 株式会社デンソーテン Division line detection device, division line detection system, and division line detection method
US20190094871A1 (en) * 2017-09-28 2019-03-28 Toyota Jidosha Kabushiki Kaisha Driving support apparatus
KR101993378B1 (en) * 2018-03-12 2019-06-26 에이치디씨아이콘트롤스주식회사 System and method for detecting and guiding parking availability using image information
CN109614913A (en) * 2018-12-05 2019-04-12 北京纵目安驰智能科技有限公司 A kind of oblique parking stall recognition methods, device and storage medium
WO2020238284A1 (en) * 2019-05-29 2020-12-03 北京市商汤科技开发有限公司 Parking space detection method and apparatus, and electronic device
CN110414355A (en) * 2019-06-27 2019-11-05 沈阳工业大学 The right bit sky parking stall of view-based access control model and parking stall line detecting method during parking
CN110390306A (en) * 2019-07-25 2019-10-29 湖州宏威新能源汽车有限公司 Detection method, vehicle and the computer readable storage medium of right angle parking stall
CN110472580A (en) * 2019-08-16 2019-11-19 北京茵沃汽车科技有限公司 The method, apparatus of detection parking stall based on full-view image, storage medium
CN110796063A (en) * 2019-10-24 2020-02-14 百度在线网络技术(北京)有限公司 Method, device, equipment, storage medium and vehicle for detecting parking space
CN111178295A (en) * 2019-12-31 2020-05-19 华为技术有限公司 Parking space detection and model training method and device, vehicle, equipment and storage medium
CN112633152A (en) * 2020-12-22 2021-04-09 深圳佑驾创新科技有限公司 Parking space detection method and device, computer equipment and storage medium
CN112562400A (en) * 2020-12-24 2021-03-26 北京筑梦园科技有限公司 Parking space line acquisition method and device and parking management system

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
何俏君等: "基于YOLOv2-Tiny的环视实时车位线识别算法", 《汽车电器》 *
白中浩: "基于视觉的车位线识别算法", 《中国机械工程》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115206130A (en) * 2022-07-12 2022-10-18 合众新能源汽车有限公司 Parking space detection method, system, terminal and storage medium
CN115206130B (en) * 2022-07-12 2023-07-18 合众新能源汽车股份有限公司 Parking space detection method, system, terminal and storage medium

Also Published As

Publication number Publication date
CN113903188B (en) 2022-12-06

Similar Documents

Publication Publication Date Title
EP3751519B1 (en) Method, apparatus, device and medium for calibrating pose relationship between vehicle sensor and vehicle
US11275962B2 (en) Method of controlling image acquisition and other related tools
CN109918977B (en) Method, device and equipment for determining idle parking space
CN111508027B (en) Method and device for calibrating external parameters of camera
CN110738150B (en) Camera linkage snapshot method and device and computer storage medium
CN108074237B (en) Image definition detection method and device, storage medium and electronic equipment
CN108596899B (en) Road flatness detection method, device and equipment
US20220270294A1 (en) Calibration methods, apparatuses, systems and devices for image acquisition device, and storage media
CN109828250B (en) Radar calibration method, calibration device and terminal equipment
CN111681285B (en) Calibration method, calibration device, electronic equipment and storage medium
CN114862929A (en) Three-dimensional target detection method and device, computer readable storage medium and robot
CN111243003A (en) Vehicle-mounted binocular camera and method and device for detecting road height limiting rod
CN113903188B (en) Parking space detection method, electronic device and computer readable storage medium
CN115082565A (en) Camera calibration method, device, server and medium
CN111862208B (en) Vehicle positioning method, device and server based on screen optical communication
US20220174254A1 (en) A camera assembly and a method
CN110188665B (en) Image processing method and device and computer equipment
CN114782555B (en) Map mapping method, apparatus, and storage medium
CN109600598B (en) Image processing method, image processing device and computer readable recording medium
CN111222446A (en) Face recognition method, face recognition device and mobile terminal
CN111340811B (en) Resolution method, device and computer storage medium for violation synthetic graph
CN115240150A (en) Lane departure warning method, system, device and medium based on monocular camera
CN114943805A (en) Parking occlusion determination method, device, equipment, storage medium and program product
CN114863096A (en) Semantic map construction and positioning method and device for indoor parking lot
JP2014142866A (en) Lane identification device, and lane identification method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant