Surface roughness determined from a depth map.

조회 수: 2 (최근 30일)
Andri de Waal
Andri de Waal 2023년 10월 2일
댓글: Andri de Waal 2023년 10월 3일
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

채택된 답변

Image Analyst
Image Analyst 2023년 10월 2일
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
Andri de Waal
Andri de Waal 2023년 10월 3일
Thank you very much for taking the time to answer my question.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Biomedical Imaging에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by