Issue with Consistent Value Reduction in 3D Point Interpolation Using MATLAB
Show older comments
I'm working on a geophysical project involving high-resolution topography and bathymetry measurements. Here's a brief overview of my process and the issue I'm encountering:
- Data Set: My data consists of 3D scattered points (X, Y, Z) in a geophysical context. The points are closely packed, with the distance between any two points being no more than 0.1 meters.
- Initial Step: Using MATLAB's ScatteredInterpolant function with 'natural' interpolation, I create an interpolated surface from these scattered points.
- Extraction Process: I then extract values from this surface along several predefined, straight, and mostly parallel lines. These lines act as transects along a shoreline and are spaced appropriately. (the spacing of points in the line is 1m; can be changed if needed).
- Regeneration of Points: The next step involves converting these lines back into a set of scattered points, effectively sampling the interpolated surface along the transects.
This process is repeated 10 times. However, I've noticed a consistent reduction in the values, particularly in the Z-axis measurements, which forms an oscillating pattern.
- Primary Concern: My main goal is to maintain the original maximum Z values from the initial scattered points in the final set after interpolation.
- Comparison: By subtracting the maximum Z values from the lines generated in the first iteration from those in the 10th iteration, I've observed a specific pattern, as shown in the attached photo. (Note, the section in the middle, I manually set to 0)

The image shows the line number vs (max_z_step10 -max_z_step1), for the middle points, I set the value manually to 0.
Question: Is there a more effective method to ensure the preservation of maximum Z values throughout this process? Any insights or alternative approaches would be greatly appreciated.
I need to either reduce the amount of z value (mainly the maximum values) reduction or at least make it consistent across all lines
Answers (1)
Hassaan
on 7 Jan 2024
I am gonna elaborate a bit on the post-processing correction with a code snippet:
% Assuming 'F' is your scatteredInterpolant object
Z_interpolated = F(Xq, Yq); % Interpolate Z values at query points (Xq, Yq)
% Assume 'original_maxima' is an array containing the original max Z for each line
for i = 1:numel(Xq)
if Z_interpolated(i) < original_maxima(i)
Z_interpolated(i) = original_maxima(i); % Enforce original maxima
end
end
% Now Z_interpolated contains interpolated values with preserved maxima
-----------------------------------------------------------------------------------------------------------------------------------------------------
If you find the solution helpful and it resolves your issue, it would be greatly appreciated if you could accept the answer. Also, leaving an upvote and a comment are also wonderful ways to provide feedback.
Professional Interests
- Technical Services and Consulting
- Embedded Systems | Firmware Developement | Simulations
- Electrical and Electronics Engineering
1 Comment
Mohammad Traboulsi
on 7 Jan 2024
Categories
Find more on Interpolation 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!