Surface roughness determined from a depth map.

2 Ansichten (letzte 30 Tage)
Andri de Waal
Andri de Waal am 2 Okt. 2023
Kommentiert: Andri de Waal am 3 Okt. 2023
Hi,
I would like to determine the surface rougness of a microscopic picture.
I have code that creates a depth map:
File_Name='CPTi_D2_75_right_off_centre.tif';
% micron/pixel
% this is the spatial resolution of the input
Resolution=0.459;
% Number of intensity levels in the image,
% if you think that the result porosity is overestimated,
% just increase this number and vice versa, it accepts integers
N=18;
A = imread(File_Name);
if ndims(A) == 3
B = rgb2gray(A);
end
level = multithresh(B ,N);
C= imquantize(B,level);
RGB1 = label2rgb(B);
imwrite(RGB1,[File_Name(1:end-4) '_Depth Map.png']);
P=zeros(size(C));
for I=1:size(C,1)
for J=1:size(C,2)
if C(I,J)==1
P(I,J)=1;
end
end
end
P=1-P;
P=bwmorph(P,'majority',1);
figure;
imshow(RGB1); title('Depth Map')
I would like to use to create a 2D graph of the various distances and then use that to calculate the surface roughness.
Can anyone help me with this? Would it be possible? If not, any other suggestions?
Thank you for taking the time to assist me.
Kind Regards,
Andri

Akzeptierte Antwort

Image Analyst
Image Analyst am 2 Okt. 2023
Looks like youi're assuming that your brightness corresponds to depth. Assuming that's true there are several definitions of roughness. In fact whole books have been written about them. Perhaps the most common are Sa and Sq. Sa is the average absolute deviation from the mean surface, in other words
Sa = mean2(abs(C - mean2(C)));
and Sq is the rms of the deviations.
  1 Kommentar
Andri de Waal
Andri de Waal am 3 Okt. 2023
Thank you very much for taking the time to answer my question.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Biomedical Imaging finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by