Skip to content

Commit 67f984a

Browse files
authored
Merge pull request #27 from dancergraham/fix-intensity-values
Test intensity values for files with and without RGB
2 parents bc20a12 + c32326b commit 67f984a

4 files changed

Lines changed: 10 additions & 14 deletions

File tree

.github/workflows/CI.yml

5.11 KB
Binary file not shown.

CONTRIBUTING.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
1-
# How to contribute
1+
### How to contribute
22

33
All contributions welcome
4-
- Ideas, feature requests 💡
5-
- bug reports 🪲
4+
- [Ideas, feature requests](https://github.com/dancergraham/e57-python/issues) 💡
5+
- [bug reports](https://github.com/dancergraham/e57-python/issues) 🪲
66
- documentation 📃
77
- sample files 🌫️
88
- tests
99
- rust code 🦀
1010
- python code 🐍
1111
- tell your friends, share the project online / via social media, ... 🗣️
1212

13-
## Best practice
14-
15-
If you know how, you should fork the repo, create a new branch and then submit a pull request.
13+
Fork the repo, create a new branch and then submit a pull request.
1614

1715
(If you are new to GitHub, you might start with a basic tutorial and check out a more detailed guide to pull requests.)
1816

Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "e57-python"
3-
version = "0.1.0-a8"
3+
version = "0.2.0-a1"
44
edition = "2021"
55

66
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
@@ -9,7 +9,7 @@ name = "e57"
99
crate-type = ["cdylib"]
1010

1111
[dependencies]
12-
pyo3 = "0.20.3"
13-
e57 = { version = "0.10.5",features =["crc32c"]}
14-
numpy = "0.20.0"
12+
pyo3 = "0.21.2"
13+
e57 = { version = "0.11.7",features =["crc32c"]}
14+
numpy = "0.21.0"
1515
ndarray = "0.15.6"

src/lib.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,14 @@ unsafe fn read_points(py: Python<'_>, filepath: &str) -> PyResult<E57> {
5252
let mut color_vec = Vec::with_capacity(pc.records as usize * 3);
5353
let mut intensity_vec = Vec::with_capacity(pc.records as usize);
5454
let mut nrows = 0;
55-
let intensity_min = pc.intensity_limits.map(|limits| limits.min).unwrap_or(0.0);
56-
let intensity_max = pc.intensity_limits.map(|limits| limits.max).unwrap_or(1.0);
5755
for pointcloud in file.pointclouds() {
5856
let mut iter = file
5957
.pointcloud_simple(&pointcloud)
6058
.expect("this file should contain a pointcloud");
6159
iter.spherical_to_cartesian(true);
6260
iter.cartesian_to_spherical(false);
6361
iter.intensity_to_color(true);
62+
iter.normalize_intensity(false);
6463
iter.apply_pose(true);
6564

6665
for p in iter {
@@ -73,8 +72,7 @@ unsafe fn read_points(py: Python<'_>, filepath: &str) -> PyResult<E57> {
7372
color_vec.extend([color.red, color.green, color.blue])
7473
}
7574
if let Some(intensity) = p.intensity {
76-
let rescaled_intensity = (intensity * (intensity_max - intensity_min)) + intensity_min;
77-
intensity_vec.push(rescaled_intensity)
75+
intensity_vec.push(intensity);
7876
}
7977
}
8078
}

0 commit comments

Comments
 (0)