You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This example code is based on this paper algorithm:
9
+
10
+
- `Efficient L\-Shape Fitting for Vehicle Detection Using Laser Scanners \- The Robotics Institute Carnegie Mellon University <https://www.ri.cmu.edu/publications/efficient-l-shape-fitting-for-vehicle-detection-using-laser-scanners>`_
11
+
12
+
The algorithm consists of 2 steps as below.
13
+
14
+
Step1: Adaptive range segmentation
15
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
16
+
17
+
In the first step, all range data points are segmented into some clusters.
18
+
19
+
We calculate the distance between each range data and the nearest range data, and if this distance is below a certain threshold, it is judged to be in the same cluster.
20
+
This distance threshold is determined in proportion to the distance from the sensor.
21
+
This is taking advantage of the general model of distance sensors, which tends to have sparser data distribution as the distance from the sensor increases.
22
+
23
+
The threshold range is calculated by:
24
+
25
+
.. math:: r_{th} = R_0 + R_d * r_{origin}
26
+
27
+
where
28
+
29
+
- :math:`r_{th}`: Threashold range
30
+
- :math:`R_0, R_d`: Constant parameters
31
+
- :math:`r_{origin}`: Distance from the sensor for a range data.
32
+
33
+
Step2: Rectangle search
34
+
~~~~~~~~~~~~~~~~~~~~~~~~~~
35
+
36
+
In the second step, for each cluster calculated in the previous step, rectangular fittings will be applied.
37
+
In this rectangular fitting, each cluster's distance data is rotated at certain angle intervals.
38
+
It is evaluated by one of the three evaluation functions below, then best angle parameter one is selected as the rectangle shape.
39
+
40
+
1. Rectangle Area Minimization criteria
41
+
=========================================
42
+
43
+
This evaluation function calculates the area of the smallest rectangle that includes all the points, derived from the difference between the maximum and minimum values on the x-y axis for all distance data points.
44
+
This allows for fitting a rectangle in a direction that encompasses as much of the smallest rectangular shape as possible.
45
+
46
+
47
+
2. Closeness criteria
48
+
======================
49
+
50
+
This evaluation function uses the distances between the top and bottom vertices on the right side of the rectangle and each point in the distance data as evaluation values.
51
+
If there are points on the rectangle edges, this evaluation value decreases.
52
+
53
+
3. Variance criteria
54
+
=======================
55
+
56
+
This evaluation function uses the squreed distances between the edges of the rectangle (horizontal and vertical) and each point.
57
+
Calculating the squared error is the same as calculating the variance.
58
+
The smaller this variance, the more it signifies that the points fit within the rectangle.
- `Efficient L\-Shape Fitting for Vehicle Detection Using Laser Scanners \- The Robotics Institute Carnegie Mellon University <https://www.ri.cmu.edu/publications/efficient-l-shape-fitting-for-vehicle-detection-using-laser-scanners>`_
0 commit comments