implement 3d sobel operator

帅比萌擦擦* 提交于 2021-02-19 06:46:46

问题


I am currently working on inhomogeniety removal from MRI data volume which contains voxels. I want to apply sobel operator on those volumes to find the gradient. I am familiar with 2d sobel mask and the neighbourhood of 2d images.

sobel mask: 1 2 1 0 0 0 -1 -2 -1 1 0 -1 2 0 -2 1 0 -1

neighbourhood of(x,y): (x+1,y-1) (x+1,y) (x+1,y+1) (x,y-1) (x,y) (x,y+1) (x-1,y-1) (x-1,y) (x-1,y+1)

Now I want to apply it on 3d. Please suggest me how should I proceed?? Thank you.


回答1:


Wikipedia has a nice introduction about that : http://en.wikipedia.org/wiki/Sobel_operator

Basically, since the sobel filter is separable, you can apply 1D filters in each of x, y and z directions consecutively. Theses filters are h(x) and h'(x) as given on wikipedia. Doing so will allow you to get the edges in the direction where you applied h'(x).
For example, if you do h(x)*h(y)*h'(z), you'll get the edges in the direction z.

Alternatively (and more expensively), you can compute the whole 3D 3x3x3 kernel and apply the convolution in 3D. The kernel for the z direction is given on wikipedia as well.



来源:https://stackoverflow.com/questions/7330746/implement-3d-sobel-operator

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!