How to do Roughness calculation from wyko vision ascii file using MATLAB?
32 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hello everyone,
I'm experiencing an issue regarding surface roughness calculation and I could use some help in troubleshooting.
Here's what I've done so far:
- I measured surface roughness using an optical profilometer and saved the data in .opd format, which is compatible with Wyko vision software.
- I opened this file in Wyko vision software and received readings of Ra=193.98 nm and Rq=301.48 nm.
- I then exported the data from the .opd file to ASCII format to use in Matlab. I applied the standard formulas for calculating Ra and Rq in Matlab. However, the results I got didn't match the readings I initially obtained from Wyko vision software.
This leads me to a couple of doubts:
a) Are the coordinate data provided by the Wyko vision software in ASCII format for Ra and Rq calculations the actual raw data, or has it been processed in some way by the software before the calculations are performed?
I'd appreciate any guidance on this issue, specifically on understanding the data processing done by Wyko software and how I can ensure my Matlab script is accurately calculating the roughness parameters.
I've also attached the ASCII file below for reference. The data from ASCII file has been put into XLSX file which I have provided
Thank you in advance for your help!
% Load data from xlsx file
data = readmatrix('3.7s1.xlsx');
% Extract z coordinates
z = data(:, 3);
% Calculate the average height
z_avg = mean(z);
% Calculate Ra (average roughness)
Ra = mean(abs(z - z_avg));
% Calculate Rq (root mean square roughness)
Rq = sqrt(mean((z - z_avg).^2));
% varied the formula as I dont know if data provided in ascii file is taken
% from a central plane or not
% Calculate Ra2 (average roughness)
Ra2 = mean(abs(z));
% Calculate Rq2 (root mean square roughness)
Rq2 = sqrt(mean((z).^2));
% Display the results
disp(['Average roughness (Ra): ', num2str(Ra)]);
disp(['Root mean square roughness (Rq): ', num2str(Rq)]);
disp(['Average roughness (Ra): ', num2str(Ra2)]);
disp(['Root mean square roughness (Rq): ', num2str(Rq2)]);
10 comentarios
Alan Stevens
el 16 de Jul. de 2023
Using your data I get Ra and Rq values at least an order of magnitude larger than those you quote above. What is the object that is being measured? What are typical roughness measure for this sort of object?
Respuestas (1)
Siraj
el 25 de Ag. de 2023
Hii! It is my understanding that you want to measure the roughness on the surface of a coating. First, you calculated the values of “Ra” and “Rq” using the Wyko vision software and then exported and read the data into MATLAB to again calculate the values of “Ra” and “Rq”. The values of “Ra” and “Rq” calculated in MATLAB differ from the values calculated in the Wyko vision software.
I tried to calculate the values of “Ra” and “Rq” in MATLAB using the code and files attached by you, but these values differ by at least an order of magnitude from what is expected.
I believe one possible reason for this difference could be the absence of a low-pass filter, which is typically used to reduce noise and smooth out the data. Additionally, the omission of a high-pass filter, designed to capture the roughness or high-frequency components, as mentioned in the algorithm, might also have an impact on the results.
Refer to the documentation below for applying filters to the data.
To remove the waviness of the data we can leverage the curve fitting toolbox.
Hope this helps.
0 comentarios
Ver también
Categorías
Más información sobre Image Processing and Computer Vision en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!