Method and application of obtaining 3D feature automobile chassis projection frame from 2D image
By extracting the intersection area comparison between the vehicle chassis projection frame and the parking space frame from the 2D image, the error problem in the calculation of the coincidence degree of the vehicle and the parking space in the existing technology is solved, and higher detection accuracy and unattended intelligent parking are achieved. basic technical support.
Patent Information
- Application Number
- CN202111525490.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-14
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2041-12-14
AI Technical Summary
In the existing smart parking technology, there is a visual error in the calculation of the coincidence between the vehicle and the parking space, resulting in insufficient detection accuracy and prone to misjudgment, especially in roadside parking sections due to the influence of the camera installation angle.
By extracting the vehicle's chassis projection frame from the 2D image and comparing it with the intersection area of the parking space frame, the degree of coincidence is calculated to improve the accuracy of parking judgment. This method establishes a model of the relationship between the inclination angle of the parking space frame and the interception height of the car detection frame, calculates the coordinates of the projection frame of the car chassis on the ground, and then obtains a more scientific and reasonable coincidence degree calculation.
It improves the accuracy of vehicle entry detection, reduces manual intervention, is suitable for unattended smart parking lots, provides higher calculation accuracy and scientificity, and adapts to different parking space frame angles and vehicle sizes.
Smart Images

Figure CN114202568B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of intelligent parking technology, and in particular to a method for obtaining a 3D feature automobile chassis projection frame from a 2D image and an application thereof. Background Art
[0002] In recent years, with the rapid development of urbanization and the rapid growth of the number of motor vehicles, more parking spaces need to be built to meet the demand for parking. In view of this, most cities have divided the areas on both sides of some roads as temporary roadside parking sections to alleviate parking pressure. Unlike closed parking lots, roadside parking sections do not have specific entrances and exits. Passing vehicles can park freely in empty parking spaces, and parked vehicles can also leave freely. The confirmation of entry and exit times is generally carried out by arranging a parking administrator, who takes photos for evidence and then calculates the relevant fees. The current method has obvious disadvantages, namely, the low degree of automation and the need for a large amount of manpower costs.
[0003] In order to solve this problem, some organizations have developed intelligent recognition technologies. For example, the Chinese invention patent with publication number: CN112560814A discloses a method for identifying vehicles entering and exiting parking spaces. This method calculates the overlapping area between the vehicle and the parking space, and calculates the overlap between the vehicle and the parking space coordinate set based on the ratio of the coordinate intersection area and the vehicle area, and determines the state of the vehicle from the change trend of the overlap in multiple consecutive frames of images. This method does not require on-site management personnel, can greatly reduce human management costs, and has higher recognition efficiency. However, the overlap between the vehicle and the parking space calculated by this method is by judging whether the two-dimensional coordinates of the vehicle in each on-site image have an intersection with the parking space coordinate set, identifying all the inflection point coordinates in the intersection coordinates, obtaining the coordinate intersection, and calculating the coordinate intersection area, that is, the overlapping area between the vehicle and the parking space. In reality, due to the visual error caused by the installation angle of the camera, some situations may occur: for example, only half of the vehicle's detection frame is in the corresponding parking space frame, and the other half is in another parking space frame, see Figure 1 or the vehicle is parked next to the parking space, and part of the vehicle's detection frame is within the parking space frame. The calculated overlap makes the detection accuracy of the vehicle entry insufficient and is prone to misjudgment.
[0004] Therefore, the present invention provides a method for obtaining a 3D feature car chassis projection frame from a 2D image, which is used to obtain a projection frame of the car chassis projected on the ground, and calculate the overlapping area between the car chassis projection frame and the parking space, thereby ensuring the accuracy of parking space judgment. Summary of the invention
[0005] The purpose of the present invention is to provide a method and application of obtaining a 3D feature automobile chassis projection frame from a 2D image in response to the above-mentioned problems. The present invention calculates the overlap by comparing the intersection area of the projection frame of the chassis frame on the ground and the actual parking space frame. This method is more scientific and reasonable than the existing calculation method, has higher accuracy than the existing overlap calculation method, and can make better use of the accurate judgment of the initial entry of the car, thereby better providing basic technical guarantee for unattended intelligent parking.
[0006] In order to achieve the above object, the technical solution adopted by the present invention is as follows:
[0007] A method for obtaining a 3D feature automobile chassis projection frame from a 2D image, the method comprising:
[0008] S1 establishes the relationship model between the parking space frame tilt angle and the car detection frame interception height:
[0009] S1.1 Collect a large number of 2D plane images containing parking spaces and vehicles, obtain the vehicle detection frame and the real parking space frame in the acquired 2D plane images; select one of the angles in the parking space frame as a reference angle for calculating the tilt angle; the tilt angles of the parking space frames in the collected images are as different as possible to obtain more reliable basic data, and record the tilt angle of the parking space frame A = {a1, a2, ....an};
[0010] S1.2 The car detection frame is cut into an upper rectangular frame and a lower rectangular frame by a cut-off dividing line. The cut-off dividing line is used as a criterion for a large area overlap between the lower rectangular frame and the parking space frame. The height of the upper rectangular frame oh = {h1, h2, ...hn} is recorded.
[0011] S1.3 The tilt angle A corresponds to the value of the height oh of the upper rectangular frame, and the relationship formula between A and oh is obtained by fitting;
[0012] Calculation of the projection frame coordinates of the S2 car chassis on the ground:
[0013] Get the 2D plane image to be analyzed, obtain the car detection frame and the real parking space frame of the vehicle in the image, assume that the coordinates of the four points of the car detection frame are the upper left (x1, y1), lower left (x2, y2), lower right (x3, y3), and upper right (x4, y4), the width of the car detection frame is w = x4-x1 = x3-x2, the height is height = y3-y4 = y2-y1, the height of the upper rectangular frame is oh, oh is calculated by the inclination angle A of the parking space frame, and the projection frame of the car chassis on the ground is also described by a parallelogram;
[0014] S2.1 When the angle of the upper left corner of the parking space frame is an acute angle, the coordinates of the vehicle chassis projection frame are calculated in the following way:
[0015] aThe horizontal coordinate of the upper left corner of the chassis projection frame is calculated based on the x1 or x2 of the car detection frame, which is shifted right by a certain proportion wlpara to the upper left position of the tire in the image. The vertical coordinate of the upper left corner of the chassis projection frame is obtained by shifting the car detection frame y1 or y4 down by oh;
[0016] b The horizontal coordinate of the lower left corner of the chassis projection frame is calculated based on the vehicle detection frame x2 or x1, which is shifted right by a distance nh and positioned near the tire in the lower left position of the image; the vertical coordinate of the lower left corner of the chassis projection frame is y2 or y3 of the vehicle detection frame;
[0017] c The horizontal coordinate of the lower right corner of the chassis projection frame is calculated based on the vehicle detection frame x3 or x4, which is shifted to the left by a certain ratio wlpara and positioned near the tire in the lower right position of the image; the vertical coordinate of the lower right corner of the chassis projection frame is calculated after correction by the ratio wpara of nh and the width w of the vehicle detection frame. The vertical coordinate of the lower right corner of the chassis projection frame is the distance of the lower right vertical coordinate of the vehicle detection frame shifted up by height*wpara, wpara=nh / w, height is the height of the vehicle detection frame;
[0018] d. The line connecting the coordinates of the upper right corner of the chassis projection frame and the coordinates of the lower right corner of the chassis projection frame is parallel to the line connecting the upper left corner of the chassis projection frame and the lower left corner of the chassis projection frame. The line connecting the coordinates of the upper right corner of the chassis projection frame and the upper left corner of the chassis projection frame is parallel to the line connecting the coordinates of the lower left corner of the chassis projection frame and the lower right corner of the chassis projection frame. The coordinates of the upper right corner of the chassis projection frame can be calculated based on these two conditions and the other three coordinate points.
[0019] S2.2 When the angle of the upper left corner of the parking space frame is an obtuse angle, the coordinates of the vehicle chassis projection frame are calculated in the following way:
[0020] a The horizontal coordinate of the upper right corner of the chassis projection frame is calculated based on the vehicle detection frame x4, which is shifted to the left by a certain ratio wlpara and positioned near the tire in the upper right position of the image. The vertical coordinate is obtained by shifting the vehicle detection frame y1 or y4 down by oh;
[0021] b The horizontal coordinate of the lower right corner of the chassis projection frame is calculated based on the vehicle detection frame x1, which is shifted right by a distance nh and positioned near the tire in the lower right position of the image. The vertical coordinate of the lower right corner of the chassis projection frame is the lower right vertical coordinate of the vehicle detection frame.
[0022] c The horizontal coordinate of the lower left corner of the chassis projection frame is calculated based on the vehicle detection frame x2, which is shifted right by a certain ratio wlpara to the lower left position of the tire in the image. The vertical coordinate of the lower left corner of the chassis projection frame is calculated after being corrected by the ratio wpara of nh and the width w of the vehicle detection frame. The vertical coordinate of the lower left corner of the chassis projection frame is shifted up by the distance height*wpara of the lower left vertical coordinate of the vehicle detection frame, wpara=nh / w, height is the height of the vehicle detection frame;
[0023] d The line connecting the coordinates of the upper right corner point of the chassis projection frame and the coordinates of the lower right corner point of the chassis projection frame is parallel to the line connecting the upper left and lower left corner points. The line connecting the coordinates of the upper right corner of the chassis projection frame and the upper left corner of the chassis projection frame is parallel to the line connecting the coordinates of the lower left and lower right corner points. The current coordinate point can be calculated based on these two conditions and the other three coordinate points.
[0024] Preferably, the present invention selects the angle of the upper left corner in the parking space frame as the reference angle for calculating the tilt angle, and calculates the tilt angle with the coordinates of the three corner points, wherein the upper left corner point is used as the corner point, and the lower left corner point and the upper right corner point are used as the remaining two points to calculate the tilt angle.
[0025] Preferably, in the present invention, when the angle of the upper left corner of the parking space frame is an acute angle, the interception dividing line is a line segment drawn horizontally based on the intersection of the left line of the car detection frame and the straight line where the horizontal line of the parking space frame located above the image is located; when the angle of the upper left corner of the parking space frame is an obtuse angle, the interception dividing line is a line segment drawn horizontally based on the intersection of the right line of the car detection frame and the straight line where the horizontal line of the parking space frame located above the image is located.
[0026] Preferably, in the present invention, wlpara in step S4 is a set proportional constant.
[0027] Preferably, in the present invention, in step S4, wlpara=0.06.
[0028] Preferably, in the present invention, the value of nh in step S2 is equal to the height oh of the upper rectangular frame as a reference and is obtained by increasing or decreasing the value. The specific method is:
[0029] Pre-training, collect a large number of pictures containing parking spaces and vehicles of different heights, and manually obtain the height of the upper rectangular box 校正 And the aspect ratio of the car detection frame wch, the aspect ratio range is 0.5-1; through ΔH=oh 校正-oh calculates the height that needs to be increased or decreased in each interception height, oh is calculated by the inclination angle A of the parking space frame; calculates the ratio of the height ΔH that needs to be increased or decreased in each interception height to the height oh, set it as aipara, aipara=ΔH / oh, the aipara value corresponds to the aspect ratio one by one, and two data sets are obtained, and the relationship formula between the two variables aipara and wch is fitted; when calculating the chassis projection frame of the 2D plane image to be analyzed, the value of nh in step S4 is nh=oh+oh*aipara.
[0030] The present invention also provides an application of a method for obtaining a 3D feature automobile chassis projection frame from a 2D image in calculating the overlap between the automobile and the parking space. The specific application method is: after obtaining the chassis projection frame of the automobile chassis area on the ground, the intersection area of the chassis projection frame and the parking space frame is calculated, which is the overlap between the automobile and the ground parking space.
[0031] In summary, due to the adoption of the above technical solution, the beneficial effects of the present invention are:
[0032] 1. The present invention uses 2D images to deduce 3D features, and deduce the projection frame of the car chassis on the ground from the car detection frame and parking space frame in the plane image. This technology is the direction of future machine vision. By using this method, in reality, it is not necessary to equip each section of road with a full set of multi-camera cameras at a full angle to jointly capture 3D features, and the 3D features in the image can be obtained. Therefore, the present invention is more suitable for the actual situation of general domestic roads.
[0033] 2. The present invention combines the calculated parking space frame inclination angle with the car detection frame through mathematical model calculation to obtain the projection of the virtual XOY plane in the Z-axis image that does not exist in the 2D image, and obtains the chassis projection frame in the vehicle 3D feature. The parameters relied on for calculation are the parking space frame inclination angle and the coordinates of the car detection frame. The parameters are easy to obtain and are also calculated through mathematical models to adapt to different parking space frame angles and vehicle sizes. That is, no matter what the camera installation angle is and what the vehicle model and size are, it can be self-adaptive to reduce manual intervention, and the calculation result is highly accurate, which is suitable for popularization and application.
[0034] 3. The present invention calculates the overlap by comparing the intersection area of the projection frame of the chassis frame on the ground and the actual parking space frame. This method is more scientific and reasonable than the existing calculation method, has higher accuracy than the existing overlap calculation method, and can make more accurate judgments when the car is initially parked, thus providing a better basic technical guarantee for unattended intelligent parking. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 This is a real-life rendering when the angle of the upper left corner of the parking space frame is an acute angle;
[0036] Figure 2 It is a schematic diagram of a calculation model when the angle of the upper left corner of the parking space frame is an acute angle;
[0037] Figure 3 is a schematic diagram of a parking space frame, a car detection frame and a chassis projection frame when the angle of the upper left corner of the parking space frame is an acute angle;
[0038] Figure 4 This is a real-life rendering when the angle of the upper left corner of the parking space frame is an obtuse angle;
[0039] Figure 5 It is a schematic diagram of the calculation model when the angle of the upper left corner of the parking space frame is an obtuse angle;
[0040] Figure 6 Schematic diagram of the parking space frame, the car detection frame and the chassis projection frame when the angle of the upper left corner of the parking space frame is an obtuse angle
[0041] Among them, 1-car detection frame; 2-parking space frame, 3-chassis projection frame. DETAILED DESCRIPTION
[0042] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0043] Different from the prior art that calculates the overlap between a vehicle and a parking space by judging whether the two-dimensional coordinates of the vehicle in each scene image have an intersection with the parking space coordinate set, which is calculated at the 2D level and may result in misjudgment, the present invention provides a method for obtaining a 3D feature vehicle chassis projection frame from a 2D image, obtaining a 3D feature vehicle chassis projection frame from 2D vehicle detection frame and parking space frame and other information, and using it in calculating the overlap between the vehicle and the parking space, which can improve the accuracy of the overlap calculation and ensure the accuracy of parking space judgment.
[0044] A method for obtaining a 3D feature automobile chassis projection frame from a 2D image, the method comprising:
[0045] S1 establishes the relationship model between the parking space frame tilt angle and the car detection frame interception height:
[0046] S1.1 collect a large number of 2D plane images containing parking spaces and vehicles, obtain the vehicle detection frame 1 and the real parking space frame 2 in the acquired 2D plane images; select one of the angles in the parking space frame 2 as the reference angle for calculating the tilt angle; the tilt angles of the parking space frame 2 in the collected images are as different as possible to obtain more reliable basic data to ensure the reliability of the fitting results; record the tilt angle A of the parking space frame 2 = {a1, a2, ....an};
[0047] In this step, the 2D plane image may be obtained by taking a photo or an image frame in a video stream through a camera set in the parking scene.
[0048] In this step, the car detection frame 1 is obtained through the existing target detection model, which is a mature technology in this field. The car detection frame 1 is generally a rectangular frame; the real parking space frame 2 is drawn according to the actual white parking space line on the ground.
[0049] In this step, the tilt angle A is calculated by the coordinates of the three corner points, for example, see Figure 2 If the angle of the upper left corner in the parking space frame 2 is selected as the reference angle for calculating the tilt angle, the upper left corner point is used as the corner point, and the lower left corner point and the upper right corner point are used as the remaining two points to calculate the tilt angle. In the graphics processing software, the coordinates of the three points can be found to obtain the size of the tilt angle; and by analogy, each corner of the parking space frame 2 can be used as a reference angle for calculating the tilt angle. Those skilled in the art can make corresponding adjustments through the technical solution described in the present invention, and can also solve the technical problem of the present invention. Selecting different reference angles is within the protection scope of the present invention.
[0050] S1.2 The car detection frame 1 is cut into an upper rectangular frame and a lower rectangular frame by a cut-off boundary line, and the cut-off boundary line is used as a criterion for a large area overlap between the lower rectangular frame and the parking space frame 2, and the height of the upper rectangular frame oh = {h1, h2, ...hn} is recorded;
[0051] In this step, when the angle of the upper left corner of the parking space frame 2 is an acute angle, the interception dividing line is a horizontal line segment drawn with the intersection of the left line of the car detection frame 1 and the straight line where the horizontal line of the parking space frame 2 located above the image is as a reference; when the angle of the upper left corner of the parking space frame 2 is an obtuse angle, the interception dividing line is a horizontal line segment drawn with the intersection of the right line of the car detection frame 1 and the straight line where the horizontal line of the parking space frame 2 located above the image is as a reference; in the modeling process, the interception dividing line can be drawn manually according to the interception standard. In actual application, the interception dividing line does not need to be drawn, and the corresponding value can be calculated according to the inclination angle A.
[0052] S1.3 The tilt angle A corresponds to the value of the height oh of the upper rectangular frame one by one and presents a certain regularity. Therefore, the relationship formula between A and oh is obtained by fitting. Specifically, the value range of the tilt angle A is 0-180°, which can be normalized to 0-1.8 and then the formula is fitted.
[0053] Calculation of the projection frame coordinates of the S2 car chassis on the ground:
[0054] Get the 2D plane image to be analyzed, obtain the car detection frame 1 and the real parking space frame 2 of the vehicle in the image, assume that the coordinates of the four points of the car detection frame are the upper left (x1, y1), lower left (x2, y2), lower right (x3, y3), and upper right (x4, y4), the width of the car detection frame is w = x4-x1 = x3-x2, and the height of the upper rectangular frame is oh, oh is calculated by the inclination angle A of the parking space frame 2 using the relationship formula between A and oh. In this step, there is no need to draw the interception dividing line, so as to adapt to intercepting different heights in different angle environments, so as to achieve self-adaptation and reduce manual intervention. The car chassis projection frame 3 of the car chassis on the ground is also described by a parallelogram;
[0055] S2.1 When the angle of the upper left corner of the parking space frame 2 is an acute angle, the coordinates of the vehicle chassis projection frame 3 are calculated in the following way:
[0056] a The horizontal coordinate of the upper left corner of the chassis projection frame 3 is calculated based on the x1 or x2 of the car detection frame 1, which is shifted right by a certain proportion wlpara to the upper left position of the tire in the image. The vertical coordinate of the upper left corner of the chassis projection frame 3 is obtained by shifting the car detection frame y1 or y4 down by oh;
[0057] b The horizontal coordinate of the lower left corner of the chassis projection frame 3 is calculated based on the vehicle detection frame x2 or x1, which is shifted right by a distance nh and positioned near the tire at the lower left position in the image; the vertical coordinate of the lower left corner of the chassis projection frame 3 is y2 or y3 of the vehicle detection frame;
[0058] c The horizontal coordinate of the lower right corner of the chassis projection frame 3 is calculated based on the vehicle detection frame x3 or x4, which is shifted to the left by a certain ratio wlpara and positioned near the tire in the lower right position of the image; the vertical coordinate of the lower right corner of the chassis projection frame 3 is calculated after being corrected by the ratio wpara of nh and the width w of the vehicle detection frame. The vertical coordinate of the lower right corner of the chassis projection frame 3 is the distance of the lower right vertical coordinate of the vehicle detection frame 1 shifted up by height*wpara, wpara=nh / w, height is the height of the vehicle detection frame 1;
[0059] d. The line connecting the coordinates of the upper right corner point of chassis projection frame 3 and the coordinates of the lower right corner point of chassis projection frame 3 is parallel to the line connecting the upper left corner point of chassis projection frame 3 and the lower left corner point of chassis projection frame 3. The line connecting the coordinates of the upper right corner of chassis projection frame 3 and the upper left corner of chassis projection frame 3 is parallel to the line connecting the coordinates of the lower left corner point of chassis projection frame 3 and the lower right corner point of chassis projection frame 3. The coordinates of the upper right corner of chassis projection frame 3 can be calculated based on these two conditions and the other three coordinate points.
[0060] S2.2 When the angle of the upper left corner of the parking space frame 2 is an obtuse angle, the coordinates of the vehicle chassis projection frame 3 are calculated in the following way:
[0061] a. The horizontal coordinate of the upper right corner of the chassis projection frame 3 is calculated based on the vehicle detection frame x4, which is shifted to the left by a certain ratio wlpara and positioned near the tire in the upper right position of the image. The vertical coordinate is obtained by shifting the vehicle detection frame y1 or y4 down by oh;
[0062] b. The horizontal coordinate of the lower right corner of the chassis projection frame 3 is calculated based on the vehicle detection frame x1, which is shifted right by a distance nh and positioned near the tire in the lower right position of the image. The vertical coordinate of the lower right corner of the chassis projection frame 3 is the lower right vertical coordinate of the vehicle detection frame;
[0063] c. The horizontal coordinate of the lower left corner point of the chassis projection frame 3 is calculated based on the vehicle detection frame x2, which is shifted right by a certain ratio wlpara to the lower left position of the tire in the image. The vertical coordinate of the lower left corner point of the chassis projection frame 3 is calculated after being corrected by the ratio wpara of nh and the width w of the vehicle detection frame. The vertical coordinate of the lower left corner point of the chassis projection frame 3 is the distance of the lower left vertical coordinate of the vehicle detection frame 1 shifted up by height*wpara, wpara=nh / w, height is the height of the vehicle detection frame 1;
[0064] d. The line connecting the coordinates of the upper right corner point of chassis projection frame 3 and the coordinates of the lower right corner point of chassis projection frame 3 is parallel to the line connecting the upper left and lower left corner points. The line connecting the coordinates of the upper right corner of chassis projection frame 3 and the upper left corner of chassis projection frame 3 is parallel to the line connecting the coordinates of the lower left and lower right corner points. The current coordinate point can be calculated based on these two conditions and the other three coordinate points.
[0065] In the above steps, wlpara in step S4 is a set proportional constant, and its value can be 0.06 according to the mathematical model. The value of nh in step S2 is equal to the height oh of the upper rectangular frame as a reference and then increased or decreased. The specific method is:
[0066] Pre-training, collect a large number of pictures containing parking spaces and vehicles of different heights, and manually obtain the height of the upper rectangular box 校正 And the aspect ratio wch of the car detection frame 1, the aspect ratio range is 0.5-1; through ΔH=oh 校正-oh calculates the height that needs to be increased or decreased in each interception height, and the height oh is calculated through the inclination angle A of the parking space frame 2; calculates the ratio of the height ΔH that needs to be increased or decreased in each interception height to the height oh, and sets it as aipara, aipara=ΔH / oh, and the aipara value corresponds to the aspect ratio one by one, and two data sets are obtained, and the relationship formula between the two variables aipara and wch is fitted; when the chassis projection frame 3 is calculated for the actual 2D plane image to be analyzed, the value of nh in step S4 is nh=oh+oh*aipara, and the aipara value can be obtained according to the wch value in the actual image, and the nh and wch values can be further obtained, which is easy to obtain, thereby simplifying the calculation.
[0067] When the present invention is actually applied, the relationship between A and oh is obtained as follows:
[0068] oh=height*(1-jPara)=height*{1-[a0+a1*cos(A*d)+b1*sin(A*d)]};
[0069] Among them, a0=0.4237, a1=-0.1549, b1=-0.08825, d=3.741, A is the tilt angle, height is the height of the car detection frame;
[0070] According to different height and width ratios, the intercepted images of different heights are corrected. The relationship formula and calculated value of the correction parameter aipara and the height and width ratio are as follows:
[0071] The height and width ratios of the vehicle detection box wch are: 0.50, 0.55, 0.60, 0.65, 0.70, 0.75, 0.80, 0.85, 0.90, 0.95, 1
[0072] Aipara is: 0.54, 0.40, 0.30, 0.22, 0.10, -0.05, -0.25, -0.48, -0.69, -0.84, -0.87;
[0073] The relationship between aipara and wch obtained by fitting is:
[0074] aipara=a0+a1*cos(wch*d)+b1*sin(wch*d)+a2*cos(2*wch*d)+b2*sin(2*wch*d)
[0075] Among them, a0=0.3336, a1=-0.06742, b1=1.051, d=5.32, a2=-0.07465, b2=0.3566.
[0076] The coordinates of the chassis projection frame 3 are:
[0077] S4.1 When the angle of the upper left corner of the parking space frame 2 is an acute angle, see Figure 2 The situation shown in;
[0078] aThe coordinates of the upper left corner of the chassis projection frame 3 are (x1+w*wlpara, y1+oh);
[0079] b The coordinates of the lower left corner of the chassis projection frame 3 are (x2+nh, y2);
[0080] The coordinates of the lower right corner of the c chassis projection frame 3 are (x3-w*wlpara, y3-(y3-y4)*wpara*aipara).
[0081] After Figure 1 The actual scene image is calculated, and the coordinate values obtained are shown in Figure 2 As shown, the quadrilateral chassis projection frame 3 can be obtained according to the coordinate values. Figure 1 In the example, the first car occupies two parking spaces, and it can be calculated that a portion of the projection frame is outside the parking space frame 2. Therefore, the present invention can distinguish whether the vehicle is parked across parking spaces; Figure 2 In the figure, a part of a car is outside the parking space frame 2. Through the correction of nh, the coordinates of the chassis frame outside the parking space frame 2 can also be accurately obtained. It can be seen that by adopting the mathematical model of the present invention, a relatively accurate automobile chassis projection frame 3 can be obtained.
[0082] When the angle of the upper left corner of the parking space frame 2 is an obtuse angle, see Figure 4 The situation shown in;
[0083] aThe coordinates of the upper right corner of the chassis projection frame 3 are (x4-w*wlpara,y4+oh);
[0084] b The coordinates of the lower right corner of chassis projection frame 3 are (x3-nh,y3);
[0085] c The coordinates of the lower left corner of the chassis projection frame 3 are (x2+w*wlpara,y2-(y2-y1)*wpara*aipara)
[0086] After Figure 3 The actual scene image is calculated, and the coordinate values obtained are shown in Figure 4 As shown, a quadrilateral chassis projection frame 3 can be obtained according to the coordinate values.
[0087] The method of obtaining the 3D feature automobile chassis projection frame 3 from the 2D image of the present invention can be used to calculate the overlap between the automobile and the parking space. The calculation method is that after obtaining the chassis projection frame 3 of the automobile chassis area on the ground, the intersection area of the chassis projection frame 3 and the parking space frame 2 is calculated, which is the overlap between the automobile and the ground parking space. The present invention calculates the overlap by comparing the intersection area of the projection frame of the chassis frame on the ground and the actual parking space frame 2. This method is more scientific and reasonable than the existing calculation method, has higher accuracy than the existing overlap calculation method, and makes better use of the accurate judgment of the initial entry of the automobile, and better provides basic technical guarantee for unattended intelligent parking.
[0088] The above description is a detailed description of the preferred feasible embodiments of the present invention, but the embodiments are not intended to limit the scope of the patent application of the present invention. All equivalent changes or modified changes completed under the technical spirit suggested by the present invention should fall within the patent scope covered by the present invention.
Claims
1. A method for obtaining a 3D feature automobile chassis projection frame from a 2D image, characterized in that: The method is: S1 establishes the relationship model between the parking space frame tilt angle and the car detection frame interception height: S1.1 Collect a large number of 2D plane images containing parking spaces and vehicles, obtain the vehicle detection frame and the real parking space frame in the acquired 2D plane images; select one of the angles in the parking space frame as a reference angle for calculating the tilt angle; the tilt angles of the parking space frames in the collected images are as different as possible to obtain more reliable basic data, and record the tilt angle of the parking space frame A = {a1, a2, ....an}; S1.2 The car detection frame is cut into an upper rectangular frame and a lower rectangular frame by a cut-off dividing line. The cut-off dividing line is used as a criterion for a large area overlap between the lower rectangular frame and the parking space frame. The height of the upper rectangular frame oh = {h1, h2, ...hn} is recorded. S1.3 The tilt angle A corresponds to the value of the height oh of the upper rectangular frame, and the relationship formula between A and oh is obtained by fitting; Calculation of the projection frame coordinates of the S2 car chassis on the ground: Get the 2D plane image to be analyzed, obtain the car detection frame and the real parking space frame of the vehicle in the image, assume that the coordinates of the four points of the car detection frame are the upper left (x1, y1), lower left (x2, y2), lower right (x3, y3), and upper right (x4, y4), the width of the car detection frame is w = x4-x1 = x3-x2, the height is height = y3-y4 = y2-y1, the height of the upper rectangular frame is oh, oh is calculated by the inclination angle A of the parking space frame, and the projection frame of the car chassis on the ground is also described by a parallelogram; S2.1 When the angle of the upper left corner of the parking space frame is an acute angle, the coordinates of the vehicle chassis projection frame are calculated in the following way: aThe horizontal coordinate of the upper left corner of the chassis projection frame is calculated based on the x1 or x2 of the car detection frame, which is shifted right by a certain proportion wlpara to the upper left position of the tire in the image. The vertical coordinate of the upper left corner of the chassis projection frame is obtained by shifting the car detection frame y1 or y4 down by oh; b The horizontal coordinate of the lower left corner of the chassis projection frame is calculated based on the vehicle detection frame x2 or x1, which is shifted right by a distance nh and positioned near the tire in the lower left position of the image; the vertical coordinate of the lower left corner of the chassis projection frame is y2 or y3 of the vehicle detection frame; c The horizontal coordinate of the lower right corner of the chassis projection frame is calculated based on the vehicle detection frame x3 or x4, which is shifted to the left by a certain ratio wlpara and positioned near the tire in the lower right position of the image; the vertical coordinate of the lower right corner of the chassis projection frame is calculated after correction by the ratio wpara of nh and the width w of the vehicle detection frame. The vertical coordinate of the lower right corner of the chassis projection frame is the distance of the lower right vertical coordinate of the vehicle detection frame shifted up by height*wpara, wpara=nh / w, height is the height of the vehicle detection frame; d. The line connecting the coordinates of the upper right corner of the chassis projection frame and the coordinates of the lower right corner of the chassis projection frame is parallel to the line connecting the upper left corner of the chassis projection frame and the lower left corner of the chassis projection frame. The line connecting the coordinates of the upper right corner of the chassis projection frame and the upper left corner of the chassis projection frame is parallel to the line connecting the coordinates of the lower left corner of the chassis projection frame and the lower right corner of the chassis projection frame. The coordinates of the upper right corner of the chassis projection frame can be calculated based on these two conditions and the other three coordinate points. S2.2 When the angle of the upper left corner of the parking space frame is an obtuse angle, the coordinates of the vehicle chassis projection frame are calculated in the following way: a. The horizontal coordinate of the upper right corner of the chassis projection frame is calculated based on the vehicle detection frame x4, which is shifted to the left by a certain ratio wlpara and positioned near the tire in the upper right position of the image. The vertical coordinate is calculated by shifting the vehicle detection frame y1 or y4 down by oh; b. The horizontal coordinate of the lower right corner of the chassis projection frame is calculated based on the vehicle detection frame x1, which is shifted right by a distance nh and positioned near the tire in the lower right position of the image. The vertical coordinate of the lower right corner of the chassis projection frame is the lower right vertical coordinate of the vehicle detection frame. c. The horizontal coordinate of the lower left corner of the chassis projection frame is calculated based on the vehicle detection frame x2, which is shifted right by a certain ratio wlpara to the lower left position of the tire in the image. The vertical coordinate of the lower left corner of the chassis projection frame is calculated after correction by the ratio wpara of nh and the width w of the vehicle detection frame. The vertical coordinate of the lower left corner of the chassis projection frame is shifted up by the distance height*wpara of the lower left vertical coordinate of the vehicle detection frame, wpara=nh / w, height is the height of the vehicle detection frame; d. The line connecting the coordinates of the upper right corner point of the chassis projection frame and the coordinates of the lower right corner point of the chassis projection frame is parallel to the line connecting the upper left and lower left corner points. The line connecting the coordinates of the upper right corner of the chassis projection frame and the upper left corner of the chassis projection frame is parallel to the line connecting the coordinates of the lower left and lower right corner points. The current coordinate point can be calculated based on these two conditions and the other three coordinate points.
2. The method for obtaining a 3D feature automobile chassis projection frame from a 2D image according to claim 1, characterized in that: Select the angle of the upper left corner in the parking space frame as the reference angle for calculating the tilt angle, and calculate the tilt angle with the coordinates of the three corner points, among which the upper left corner point is used as the corner point, and the lower left corner point and the upper right corner point are used as the remaining two points to calculate the tilt angle.
3. The method for obtaining a 3D feature automobile chassis projection frame from a 2D image according to claim 1, characterized in that: When the angle of the upper left corner of the parking space frame is an acute angle, the interception dividing line is a horizontal line segment drawn based on the intersection of the left line of the car detection frame and the straight line where the horizontal line of the parking space frame located above the image is located; when the angle of the upper left corner of the parking space frame is an obtuse angle, the interception dividing line is a horizontal line segment drawn based on the intersection of the right line of the car detection frame and the straight line where the horizontal line of the parking space frame located above the image is located.
4. The method for obtaining a 3D feature automobile chassis projection frame from a 2D image according to claim 1, characterized in that: In step S4, wlpara is the set proportional constant.
5. The method for obtaining a 3D feature automobile chassis projection frame from a 2D image according to claim 1, characterized in that: In step S4, wlpara=0.
06.
6. The method for obtaining a 3D characteristic automobile chassis projection frame from a 2D image according to claim 1, characterized in that: The value of nh in step S2 is equal to the height oh of the upper rectangular frame as a reference and is obtained by increasing or decreasing the value. The specific method is: Pre-training, collect a large number of pictures containing parking spaces and vehicles of different heights, and manually obtain the height of the upper rectangular box 校正 And the aspect ratio of the car detection frame wch, the aspect ratio range is 0.5-1; through ΔH=oh 校正 -oh calculates the height that needs to be increased or decreased in each interception height, oh is calculated by the inclination angle A of the parking space frame; calculates the ratio of the height ΔH that needs to be increased or decreased in each interception height to the height oh, set it as aipara, aipara=ΔH / oh, aipara value corresponds to the aspect ratio one by one, and two data sets are obtained, and the relationship formula between the two variables aipara and wch is fitted; when calculating the chassis projection frame of the actual 2D plane image to be analyzed, the value of nh in step S4 is nh=oh+oh*aipara.
7. Application of the method for obtaining a 3D characteristic automobile chassis projection frame from a 2D image as described in any one of claims 1 to 6 in calculating the overlap between a car and a parking space.
8. The use according to claim 7, characterized in that: The application method is: after obtaining the chassis projection frame of the car chassis area on the ground, calculate the intersection area of the chassis projection frame and the parking space frame, which is the overlap degree between the car and the ground parking space.
