Surface roughness determined from a depth map.
2 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
采纳的回答
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)));
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Biomedical Imaging 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!