Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems with normalize_intensity and track_sensor #548

Closed
cflynn8 opened this issue Mar 11, 2022 · 10 comments
Closed

Problems with normalize_intensity and track_sensor #548

cflynn8 opened this issue Mar 11, 2022 · 10 comments
Assignees
Labels
Enhancement Not actually a bug but a possible improvement

Comments

@cflynn8
Copy link

cflynn8 commented Mar 11, 2022

I am trying to use lidR for the intensity normalization function it offers and I am consistently running into trouble. I have several different ALS datasets that I have tried with and am hoping to get some direction to figure out what is going wrong. I can provide sample .las files if needed.

Here is the code in RStudio:

library(lidR)

las1 <- readLAS("11SPS180600.las", filter = "-drop_withheld")
plot(las1, color = "Intensity")
las1 <- filter_duplicates(las1)
sensor <- track_sensor(las1, Roussel2020(pmin = 50))
las_norm <- normalize_intensity(las1, range_correction(sensor, Rs = 2000))
#> 3 coordinates detected in the sensor positions, parameter 'elevation' is not considered.
#> Error: 'gpstime range from the sensor does not contain gpstime range from the point-cloud

Any help is greatly appreciated!

@Jean-Romain
Copy link
Collaborator

Jean-Romain commented Mar 12, 2022

The code looks legit. My guess is that few first or last sensors locations were missed for unknown reason. I need a file to reproduce and figure out if the internal code requires improvements or if it comes from your file

@cflynn8
Copy link
Author

cflynn8 commented Mar 14, 2022

Thank you for the quick response. Here is the same las file I tried to test with in that code example. https://gmuedu-my.sharepoint.com/:f:/g/personal/cflynn8_gmu_edu/Eup5N1vIuXRDmMCRaRETr7IBnnfNi4AicR6aemTaKP1G7w?e=EbYcFC

@Jean-Romain
Copy link
Collaborator

Jean-Romain commented Mar 14, 2022

I see

range(sensor$gpstime)
#> [1] 320787224 320962446
range(las1$gpstime)
#> [1] 320787222 320962446

As expected the very first measurement is missing probably because there was not enough data to compute anything at the edge of the tile. This should not prevent to use the function normalize_intensity so I will add some tolerance tomorrow.

@Jean-Romain
Copy link
Collaborator

Jean-Romain commented Mar 14, 2022

I fixed your issue. But here some additional comment

  1. Your dataset is flat no need to apply a range correction there is nothing to correct
  2. Without a buffer and extra tiles on the edges the accuracy of the sensor detection is not super accurate. Especially there are 2 outliers at 400 and 700 m height.
  3. Your intensities range between 0 and 65535 i.e. the maximum storable value of intensity. When applying the range correction most of the points see their intensity lowered (because Rs = 2000 i.e. higher than the actual sensor) but some see their intensity increased. But it is not possible because the new values are above the maximum. Consequently you have many warnings.

@Jean-Romain Jean-Romain self-assigned this Mar 15, 2022
@Jean-Romain Jean-Romain added the Enhancement Not actually a bug but a possible improvement label Mar 15, 2022
@cflynn8
Copy link
Author

cflynn8 commented Mar 15, 2022

Okay that makes sense. I am working with much larger datasets but just grabbed a random tile to try to test with for simplicity. I am mostly hoping to reduce the intensity of points collected over water at nadir that result in very high intensity return values. Unfortunately, I am still getting the same error. I do not see any option to update the package in RStudio either. Is there something else I need to do so that what I am running mirrors the fix you made? Thank you!

@Jean-Romain
Copy link
Collaborator

Jean-Romain commented Mar 15, 2022

reduce the intensity of points collected over water at nadir that result in very high intensity return values.

You applied a range corrections. Not a water correction

I do not see any option to update the package in RStudio either

remotes::install_github("r-lidar/lidR")

@cflynn8
Copy link
Author

cflynn8 commented Mar 21, 2022

Thank you! That install worked for me and the tool ran fine on that tile. I tried to build slightly from there and run it with an LAS catalog of just 9 tiles. It started to process the area and one of the tiles completed. However, it failed on the tile that I had been testing individually (and supplied here). Is there any reason that the tool would fail when processing an LAS catalog?

Also, is there a water correction? I had not seen one.

Thanks!

@Jean-Romain
Copy link
Collaborator

I cannot know without a reproducible error. Please open a new issue explaining what is going wrong.

@candelas762
Copy link

candelas762 commented Jul 15, 2022

  1. Your dataset is flat no need to apply a range correction there is nothing to correct

Hi, I was wondering what you meant by "flat". Is it that is normalized? I checked the file and indeed it seems to be normalized (although heights are below 0). In this case I have the following question, is not correct to normalize intensity if the LAS file is already height normalized?

@Jean-Romain
Copy link
Collaborator

is not correct to normalize intensity if the LAS file is already height normalized?

If the dataset is normalized you can't retrieve the sensor position and you can't measure the distance between the sensor and the targets

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Not actually a bug but a possible improvement
Projects
None yet
Development

No branches or pull requests

3 participants