how to get gradient of an image
3 次查看(过去 30 天)
显示 更早的评论
hi im having a hyperspectral image and im trying to get the gradient operators of the horizontal and vertical directions but i can't any help? Thanks
0 个评论
采纳的回答
Walter Roberson
2013-4-8
for band = 1 : size(X,3)
[GX(:,:,band), GY(:,:,band)] = gradient(X(:,:,band));
end
Note you get out two matrices the same size as the original.
9 个评论
更多回答(2 个)
Image Analyst
2013-3-25
The Image Processing Toolbox has imgradient() and imgradientxy() functions.
5 个评论
Image Analyst
2013-4-8
移动:DGM
2023-12-29
That does not make sense to me. In the lateral x,y direction you have units of "per pixel" but in the Z direction since the planes are different wavelengths, not distance in pixels, the gradient is not a spatial gradient. It would have units of "per wavelength". And you certainly wouldn't want a 3D gradient with spatial coordinates mixed with wavelength coordinates. It makes no sense, at least not to me.
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!