mparkan / Digital-Forestry-Toolbox

A collection of digital forestry tools for Matlab/Octave
http://mparkan.github.io/Digital-Forestry-Toolbox/
GNU General Public License v3.0
46 stars 16 forks source link

treemetrics #5

Closed deryagulcinubc closed 4 years ago

deryagulcinubc commented 4 years ago

Hi. I am doing Tutorial 2. But it gives me this error:

Expected one output from a curly brace or dot indexing expression, but there were 12267 results.

Error in treeMetrics (line 1276) metrics.ConcaveHull3D{k,1} = nan;

Error in dft_tutorial_2 (line 191) metrics_3d = treeMetrics(label_3d, ...

deryagulcinubc commented 4 years ago

I also have an error when I use shapewrite: Error: File: shapewrite.m Line: 1 Column: 1 Invalid text character. Check for unsupported symbol, invisible character, or pasting of non-ASCII characters.

Error in dft_tutorial_2 (line 251) shapewrite(S, 'C:\matlaboutput\shape.shp'); % IMPORTANT: adjust the path to the output SHP file

How can I get tree crowns as shapfiles? Is that possible?

deryagulcinubc commented 4 years ago

untitled

deryagulcinubc commented 4 years ago

Unfortunately, Tutorial gives this histogram which I understand that is something wrong. Here is the error: Error using reshape To RESHAPE the number of elements must not change.

Error in dft_tutorial_4 (line 174) C = reshape(C, nrows, ncols); I only need to save tree crowns as shapefiles with lidar metrics. Could you help me?

deryagulcinubc commented 4 years ago

My Point data was classified as: 1-Unclassified; 2-Bare-earth and low grass; 3-Low vegetation (height <2m); 4-High vegetation (height <2m); 5-Water; 6-Buildings; 7-Other; and 8-Noise (noise points, blunders, outliners, etc)​

mparkan commented 4 years ago

Hello,

I just tested the tutorial 2 on the latest version of Octave (5.2.0) and it worked just fine. To the best of my knowledge it also works in previous versions of Octave. I cannot test it on Matlab currently, because I do not have access to a license.

Unfortunately your question is missing important information:

If you can provide this information, it might be possible to determine where the errors are coming from.

Please do not use the issue tracker to ask for personal support with Matlab/Octave programming, but only to report bugs and/or feature requests.

deryagulcinubc commented 4 years ago

Hi Dr. Parkan,

Many thanks. I am using Matlab 2019b and my detail of my las files are here below. My project site is the main campus of British Columbia University.

https://opendata.vancouver.ca/explore/dataset/lidar-2018/information/

Tha las classes that you are using in the tutorial and mine are different. So in the tutorial scripts I changed the class numbers. There is an another issue in tutorial 2. In line 199, you wrote "all". But this gave me error. So i changed it into 'metrics', {'Identifier', 'IntensityMetrics', 'OpacityMetrics', 'ConvexVolume', 'ConvexArea', 'TotalHeight'}, ... Then it worked. But i missed 'pointmetrics' for this time. Then I deleted line 199, and only wrote 'pointmetrics' . This gave me an error. So in tutorial 2 I have problems with pointmetrics and shapewrite.

Tutorial 2 gives an error at shapewrite stage. Error: File: shapewrite.m Line: 1 Column: 1 Invalid text character. Check for unsupported symbol, invisible character, or pasting of non-ASCII characters.

Error in dft_tutorial_2 (line 251) shapewrite(S, 'C:\matlaboutput\shape'); % IMPORTANT: adjust the path to the output SHP file

I also have some problems in tutorial 4. Histogram is quite strange. I do not know why. Segmentation is so important for me. I need to have shapefiles of tree crowns that you show in interactive map.

Both in my paper and also my report, I would like to cite the toolbox. Which version should I use? 2020 is the latest, right?

If you can help me, I would be thankful Dr Parkan. I am looking forward to hearing from you.

Best regards, Derya

Matthew Parkan notifications@github.com, 12 Şub 2020 Çar, 12:12 tarihinde şunu yazdı:

Hello,

I just tested the tutorial 2 on the latest version of Octave (5.2.0) and it worked just fine. To the best of my knowledge it also works in previous versions of Octave. I cannot test it on Matlab currently, because I do not have access to a license.

Unfortunately your question is missing important information:

-

The version Matlab/Octave and associated versions Toolboxes/Packages you are using

The exact code you are running (did you modify any of the original scripts/functions?)

The characteristics of the LAS file you are trying to process

If you can provide this information, it might be possible to determine where the errors are coming from.

Please do not use the issue tracker to ask for personal support with Matlab/Octave programming, but only to report bugs and/or feature requests.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/mparkan/Digital-Forestry-Toolbox/issues/5?email_source=notifications&email_token=ANSPWTJZAB5ORBKU3PRGTKLRCRJZVA5CNFSM4KRWNA72YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOELSG5HI#issuecomment-585395869, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANSPWTIFZ7K5ZNEMXMLEN6LRCRJZVANCNFSM4KRWNA7Q .

mparkan commented 4 years ago

Hello,

After testing the tutorial 2 in Matlab r2019b, I found an error related to the computation of the concave hulls (a Matlab only only option) in the TreeMetrics function. The error is resolved, so running treeMetrics with the "all" option should work correctly now. You can download the corrected version and substitute it in the "\scripts\tree metrics\" folder.

The errors related to the shapewrite are due to incompatibility of the function with Matlab. This function is an external dependency, so I'll have to review the code and report the issues to the Octave package developer. Until this issue is resolved, I would suggest to delete the "shp" and "dbf" folders (located in "\scripts\io\") from the DFT toolbox and just use the shapewrite function from the official Matlab Mapping toolbox.

deryagulcinubc commented 4 years ago

Hi Dr Parkan,

Many thanks. I will run the codes again. In tutorial 2, figure 2 shows marker-controlled watershed segmentation. I have this one as figure but I could not export it as polygon shapefile. Could you also run tutorial 4 in Matlab 2019b? My histogram looks so strange. I am in a bit hurry and need to submit my first report. I still could not figure out how to export figure 2 as shapefile and also deal with the error comes from 4th tutorial.

mparkan commented 4 years ago

Hello,

You cannot export a shapefile from a Matlab figure. This is done in step 9 of tutorial 2. Note that the treetop locations (points) are exported, not the crown extent polygons. I'll probably add the latter option, when I have some time.

Tutorial 4 does not have any issues in Matlab r2019b or Octave 5.2.0. The method explained in this tutorial is suited for leaf-off acquisitions, when there is a large intensity contrast between deciduous and persistent foliage. However, it appears that the Vancouver data-set your are using was acquired in leaf-on conditions. I had a look at the acquisition dates of tile 4830E_54560N in this the data-set using:

utc_time = gps2utc(pc.record.gps_time + 10^9, 'verbose', true);

Which returned:

day 1: 28-Aug-2018
day 2: 29-Aug-2018

I would strongly suggest reading about the methods used in these tutorials (see references section), understand their applicable scope and limitations, figure out what implications these may have for your work assumptions.

mparkan commented 4 years ago

I've modified tutorial 2 to allow export of segment (individual tree) boundaries. Let me know how it works.

deryagulcinubc commented 4 years ago

Great news! I will run it so soon!

Thanks a lot. Best, Derya

iPhone’umdan gönderildi

Matthew Parkan notifications@github.com şunları yazdı (24 Şub 2020 14:07):

 I've modified tutorial 2 to allow export of segment (individual tree) boundaries. Let me know how it works.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

mparkan commented 4 years ago

Closing this due to inactivity.