Aligning surfaces to find height difference
21 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hi
I have 3D data from a CMM of multiple similar surfaces, I'm studying the height difference in these surfaces. What is the most striaght-forward way to align these surfaces so I can then find the difference between them?
(If it is easier to look at these as 2D surfaces I can do this as it is only the height difference I'm currently looking at)
Thanks in advance!
2 commentaires
Image Analyst
le 29 Juil 2023
What exactly are we supposed to be seeing when you say "these surfaces"?
And if you change (shift or tilt) one surface, then you're no longer looking at the original height differences. Are you sure you want to look at the altered height differences instead?
If you have any more questions, then attach your data and code to read it in with the paperclip icon after you read this:
Réponses (1)
Yatharth
le 29 Août 2023
Hi , I understand that you are trying to find the height difference between multiple surfaces obtained via CMM. However aligning them or modifying their position in terms of Z axis might alter your data and you will have incoorect values for height. Instead you can select one of the surfaces as the reference surface. This surface will serve as the baseline for comparison with the other surfaces.
To find the height difference between multiple similar surfaces, you can follow these steps:
1. Define a reference surface
2. Establish corresponding points: Identify corresponding points on the reference surface and each of the other surfaces. These points should represent the same location or feature on each surface. You can use feature matching techniques or manual selection to establish correspondences.
3. Calculate the height difference between the reference surface and the other surfaces
here's an example for the same
% Generate dummy 3D data for three surfaces
surface1 = rand(10, 10); % Reference surface
surface2 = rand(10, 10); % Surface 2
surface3 = rand(10, 10); % Surface 3
% Define corresponding points
% In this example, we assume the surfaces have the same dimensions
[row, col] = size(surface1);
[X, Y] = meshgrid(1:col, 1:row); % Generate grid coordinates
% Calculate height difference
height_diff_2 = surface2 - surface1;
height_diff_3 = surface3 - surface1;
% Visualize the height differences
figure;
subplot(1, 2, 1);
imagesc(height_diff_2);
colorbar;
title('Height Difference - Surface 2');
subplot(1, 2, 2);
imagesc(height_diff_3);
colorbar;
title('Height Difference - Surface 3');
you can use the height_diff_n matrix to analyse your data statistically.
you can learn more about the imagesc and colorbar here.
3 commentaires
Yatharth
le 7 Sep 2023
Hi, since your data has a separate Z axis you can directly find the difference between the height of the two arrays
Note: Make sure you make both the array size equal and concatenate the smaller one with zeros at the start or at the end
here's the code for your reference.
filename = 'LinerA.xlsx';
sheet = 'Sheet2';
filename2 = 'LinerB.xlsx';
% Specify the columns you want to load (e.g., columns A and B)
columns = 'A:C';
% Load the specified columns as a cell array
data1 = xlsread(filename, sheet, columns);
data2 = xlsread(filename2, sheet, columns);
z1 = data1(:,3);
z2 = data2(:,3);
temp_z = zeros(length(z2) - length(z1) , 1);
z1 = [z1 ; temp_z]
height_diff_2 = z2-z1
% Visualize the height differences
figure;
subplot(1, 2, 1);
imagesc(height_diff_2);
colorbar;
title('Height Difference - Surface 2');
I hope this helps.
Voir également
Catégories
En savoir plus sur Surface and Mesh Plots dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!