필터 지우기
필터 지우기

Smoothing 3D Matrix in z-direction

조회 수: 8 (최근 30일)
Eunan McShane
Eunan McShane 2020년 4월 2일
답변: Markus 2023년 10월 25일
Hey guys, I've been trying to find a solution for smoothing a 3D (512x101x1200) matrix in the z direction, but was unsure how to proceed
I have conventional used 2D data sets for this kind of smoothing (arbritarily I use something like a 5point smoothing) but I am having trouble adapting this now to the third dimension
So ideally I would proccess the matrix by smoothing it in the z-direction, if anyone can help me with this it would be greatly appreicated. Apologies I can't attach my actual data as it is too large but any 3D matrix is sufficient!
Thank you!
  댓글 수: 2
Rik
Rik 2020년 4월 2일
Have you considered convolutions? They are generally relatively easy to extend to higher dimensions once you have them working in lower dimensions. That is the reason my region growing function supports dimensions higher than 3, even if I don't think anyone will ever use that.
Eunan McShane
Eunan McShane 2020년 4월 2일
Hey, thanks for getting in touch. I hadn't before now, are you suggesting that by using your function I can convolve a series of neigbouring points into one?

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

답변 (2개)

Ameer Hamza
Ameer Hamza 2020년 4월 2일
See convn(): https://www.mathworks.com/help/matlab/ref/convn.html. You can directly do 3D convolution.

Markus
Markus 2023년 10월 25일
Hi,
this works, but it's a slow solution:
Assuming you have a matrix called 'data' that is (512x101x1200)
for x = 1:512
for y = 1:101
smooth(data(x,y,:))
end
end
It's a nested for loop so it's not very fast. If you concatenated all z columns their beginnings and ends get smoothed together, hence you need to smooth them one by one.

카테고리

Help CenterFile Exchange에서 Smoothing and Denoising에 대해 자세히 알아보기

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by