How to accurately measure the height of a 3D structure?
Show older comments
I have a 3D data array consisting of a scan of a semi-circular sample on a flat surface. The purpose of this is to image and afterwards detect the height and width of each sample.
To do so, I wrote the following:
data_raw = load('sample.asc'); %3 columns with hundreds of rows
data_filt = imgaussfilt3(data_raw);
x = data_filt(:,1);
y = data_filt(:,2);
z = data_filt(:,3);
dotsize = 6;
scatter3(x, y, z, dotsize, z, 'filled'); %colobar linked to height (z-axis)
xlim([-6 14])
ylim([-20 -6]) %limits where the sample is
I wrote the limits above, as the original image goes from [(-60, 60), (-40, 40) ,(-10, 15)], and this included a lot of noise and unnecessary image space (especially when using the function plot3 instead of scatter3).
To try and measure the height of the sample and its width I thought of doing a simple max/min subtraction within a certain space array, but unfortunately there is enough noise that would make this not work. Is there another way of doing this?
The images below demonstrate the noise and the image before the array limits.
The image above shows all the noise around of the surface on which the sample laid on and why I applied the above limits.
The image below shows the noise still around the area of interest. How do I get the height and width (accurately) of the sample in this case?

Update:
I have attempted using imdistline and drawline the first one can only be used in a single dimension and I don't know how to obtain the lengthof the latter.
5 Comments
Matt J
on 14 Mar 2023
We would probably need data_raw in a .mat file attachment to analyze the problem in any meaningful way.
Goncalo Costa
on 15 Mar 2023
Goncalo Costa
on 15 Mar 2023
Mathieu NOE
on 15 Mar 2023
you could share it via internet (like Googledrive or alike) and share the link
Goncalo Costa
on 15 Mar 2023
Edited: Goncalo Costa
on 15 Mar 2023
Accepted Answer
More Answers (0)
Categories
Find more on Creating, Deleting, and Querying Graphics Objects in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
