bi0m3trics / spanner

Utilities to support landscape-, forest-, and tree-related data collection, manipulation, analysis, modelling, and visualization.
GNU General Public License v3.0
22 stars 8 forks source link

Stripes in processed point clouds #6

Closed rdeinin closed 5 months ago

rdeinin commented 6 months ago

Hello,

I'm trying to use spanner to preform individual tree segmentation on some mobile and terrestrial lidar scans I have. I'm using your example code, and running my own files through it. When I download the example files you have provided and run hose through the same code it turned out fine. However when I use my scans they turn out having stripes in them (photo below). I think it might be due to the high level of noise in the point clouds since they are taken in denser vegetation but I'm not sure. Have you ever run into this before or would you know how to troubleshoot the problem.

Screenshot 2024-02-21 at 8 02 25 PM
bi0m3trics commented 6 months ago

Initial troubleshooting could be done by verifying that the stem map from Raster_Eigen_TreeLocations "looks" correct and isn't oversegmenting (i.e., finding too many trees and thus giving Segment_Graph too many starting points). A second troubleshooting approach (and you can ignore this if return.dense = FALSE) would be to have Segment_Graph only return boht the sparse and dense point cloud and see if the striping results from that step (assigning sparse point treeID to the dense cloud). Without knowing the forest type, species, tree and forest structure, growth patterns, etc, and without access to the scan (if you can provide me this scan I can trouble shoot a bit on my end) this is all I can help with for now. This approach/algorithm was developed in ponderosa pine forests (AZ/NM) and has been successfully applied to longleaf pine forests(GA/FL), so if you're in a different forest types it could (and likely will) have unanticipated behaviors. Andrew

rdeinin commented 6 months ago

Hello Andrew! Thank you for your quick response. I collected my scans in interior Alaska, they generally fall into three categories: black spruce, white spruce alder mix, and birch or aspen. I'll try your troubleshooting suggestions and see what I can find. I've shared a couple google drive links bellow with point clouds. Plot 40 is dense black spruce and 88 is more open. -Rachel https://drive.google.com/file/d/1rLKwYBZWCL9F_t5ua3dKu_e8PZhtJ_36/view?usp=share_link https://drive.google.com/file/d/1Y3i6qiNXAUIt6xehtz8OOA3dlCAbUiUF/view?usp=share_link

bi0m3trics commented 6 months ago

Downloading now... and knowing it's a BLK2GO and interior Alaska Dr Seuss forests (tee hee!) is a helpful place to start.

rdeinin commented 6 months ago

Hello, I've also got scans from Zen Horizon and Faro Scene as well! The forests up there are really amazing! I do suspect some of my scans are simply too dense to be segmented, especially the ones with alders.

bi0m3trics commented 6 months ago

Well, congratulations, it's definitely a bug and I don't know why it would be striped at this point. Now the real work begins....

rdeinin commented 6 months ago

I've been trying a few new scans and I've discovered spanner works for the Faro Focus scans. The issue must be due to some difference in the point clouds between mobil and terrestrial scans rather than the tree type. The photos are from plots 40 and 88, the ones I sent you the point clouds for.

Screenshot 2024-02-23 at 4 22 44 PM Screenshot 2024-02-23 at 4 22 35 PM
bi0m3trics commented 6 months ago

Hmmm... I would image it'll work on the Zeb too then, since that's what we built it for (and I've run BLK360 and Reigl 400i through it). Still... must be a bug and I'll have to figure it out.

rdeinin commented 5 months ago

Hello, I wanted to ask what you do for your preprocessing protocol of MLS point clouds? Both my BLK360 and Zen Horizon scan come out with stripes and I'm wondering if it is something I am doing or missing in my preprocessing. I'de like to compare my protocol with yours to see if I can find anything.

bi0m3trics commented 5 months ago

So for the BLK360 - we just pass the individual .blks through cyclone and get them in .pts and .laz file format. If it's a multisetup scan, we use the auto register option with the sphere targets and/or the visual alignment tools and the finalize and export the same as above.

For the Zeb Horizon, we just drag and drop them into connect, process them and then export to .laz. Sometime we don't even do this, we just drag and drop and then use a script to gran the results.laz files from the working folders connect creates and just rename those.

So no preprocessing, no classification, no noise reduction, no downsampling....just the raw, initially processed lidar.

Any chance you could provide the suspect plot 40 files for the BLK360 and Zeb that is creating stripes? I could take the .blk and .geoslam files instead and see if my processing pipeline gives me different results.

It's spring break, so I've allotted myself some time this week to debug this an other issues in a few of my packages.

Andrew

rdeinin commented 5 months ago

I've found something interesting. I was putting together a folder yesterday with a few plots from each scanner to share with you. There is a Zeb, BLK, and FARO file from plot 40 in the folder. Folder link: https://drive.google.com/drive/folders/1G5bejwR7zGeWG6P-VzmRqf0-fQSFBBsu?usp=sharing I wanted to double check some of my results and reran one of the FARO files through the Spanner segmentation process. However, this time it came out striped. The only difference between when they worked and when they didn't was that I have since georeferenced the scans using ALS files from G-LiHT (Applied global shift/scale in Cloud Compare and visually aligned them). I retested it today with the non-georef FARO files and once again they work. Any idea why this may be? I've also added a G-LiHT file to the folder.

bi0m3trics commented 5 months ago

Interesting... makes me think it's related to the scale and offset for storing the doubles as integers... but now I have something to try. I know what I'm doing tonight... Thanks, Andrew

bi0m3trics commented 5 months ago

@rdeinin Well, I don't want to jinx myself as I have a little more testing to do, but I added some code in segment_graph to move the cloud and tree list to the origin (0,0) and then segment and then return them to the original projection and it seems to be working.
I'm running the the faro now and the zeb is next and here's plot 40 for the blk2go image I'll see how these go, and if it's working I'll modify the segment_graph function (it's just a shift, so it should impact speed minimally) and push it to get hub today. This all makes me fairly certain it's related to scale and offset, so I'm putting this link here as a reference - https://gis.stackexchange.com/questions/360247/rescaling-and-reoffsetting-a-point-cloud-with-lidr

bi0m3trics commented 5 months ago

Yep... the faro scan worked fine (below). I'll get to modifying the code and push a new version today. I'll tag you when I do and maybe ask you to try it on a few other plots just to make sure it's not my code-fu. -a image

rdeinin commented 5 months ago

That great! I can't wait to test it

bi0m3trics commented 5 months ago

@rdeinin Alright... I just committed bf9a9bd and it works with all the files you sent me. If you could try it with a couple (maybe different) files and confirm it's working, I'll close this issue. -a

bi0m3trics commented 5 months ago

Marking this one as closed citing bf9a9bd