Bug in data_classes?
Nobody has claimed this yet.
- Dominant language
- Jupyter Notebook
- Stars
- 390
- Forks
- 99
- PR merge metrics
- No merged PRs in 30d
Description
I believe that there is a small flaw in the data_classes.py file in the LidarPointCloud class (PointCloud). Because not all files that I tried to get have the same format for the reshape ((- - 1, 5)) [:,: cls.nbr_dims ()], that is, points = scan.reshape ((- -, 5) ) [:,: cls.nbr_dims ()]. I encountered such a problem in scene 21.
So, I replaced the LidarPointCloud (PointCloud) class with:
class LidarPointCloud(PointCloud):
@staticmethod
def nbr_dims() -> int:
"""Returns the number of dimensions.
Returns: Number of dimensions.
"""
return 4
@classmethod
def from_file(cls, file_name: Path) -> "LidarPointCloud":
"""Loads LIDAR data from binary numpy format. Data is stored as (x, y, z, intensity, ring index).
Args:
file_name: Path of the pointcloud file on disk.
Returns: LidarPointCloud instance (x, y, z, intensity).
"""
assert file_name.suffix == ".bin", "Unsupported filetype {}".format(file_name)
scan = np.fromfile(str(file_name), dtype=np.float32)
if len(scan) % 5 == 0:
points = scan.reshape((-1, 5))[:, : cls.nbr_dims()]
else:
scan0=[]
scan1=[]
scan2=[]
scan3=[]
scan4=[]
scan_pontos = []
scan_pontos = scan.reshape((-1, 1))
dv = 0
for divisao in range(math.floor(len(scan)/5)):
if (dv+4)<=len(scan):
scan0.append(scan_pontos[dv])
scan1.append(scan_pontos[dv+1])
scan2.append(scan_pontos[dv+2])
scan3.append(scan_pontos[dv+3])
scan4.append(scan_pontos[dv+4])
dv = dv+5
points = np.concatenate((scan0,scan1,scan2,scan3),axis=1)
return cls(points.T)
I I believe that now I got the correct point cloud values.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in data_classes.py at the LidarPointCloud and PointCloud implementations, then inspect how scene 21's .bin file is loaded. Compare the reshape assumptions with the provided alternative handling for files whose length is not divisible by five. Done means the affected files load with correct point-cloud values without breaking the existing format.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- numpy, python
- Domain
- computer-vision
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100