How to detect a curve (surface roughness) from image?

11 ビュー (過去 30 日間)
Sepehr Simaafrookhteh
Sepehr Simaafrookhteh 2021 年 4 月 4 日
I am working with a stack of 2D projections from X-ray microCT. I am going to find the coordinates of surface roughnesses curvature on 2D images and then extend it to 3D to have a cloud of points.
Images are like this:
I used "edge" function with different methods, but the results are not perfect, there are some separated lines and noises. I appreicate any better solution for this purpose and how can I get the coordinates of the detected curve? I assume then I have to apply a loop to get the results for the whole volume.
Thank you in advance for your help/comments.

採用された回答

darova
darova 2021 年 4 月 4 日
編集済み: darova 2021 年 4 月 4 日
  • binarize image first
  • remove noise using bwareaopen
  • use edge
  • remove noise if needed using bwareaopen
  7 件のコメント
darova
darova 2021 年 4 月 6 日
Let's say A is your image
A = sprintf('image.png'); % read first image to get size
[m,n] = size(A);
ix1 = 1:n; % value for interpolation
Z = zeros(500,n); % create matrix for 500 images profiles
for i = 1:500
s = sprintf('image%d.png',i);
A = imread(s); % read binary image
[~,y] = max(A); % find max index (ones)
ix = find(y); % find non-zero elements
y1 = interp1(ix,y(ix),x1); % inteprolate zero values
Z(i,:) = y1; % fill 2d matrix
end
surf(Z)
Sepehr Simaafrookhteh
Sepehr Simaafrookhteh 2021 年 4 月 17 日
Thank you darova. You really helped me with your hints.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeImage Processing Toolbox についてさらに検索

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by