imgradientxy - 图文-

2026/1/23 23:13:06

Read image into a gpuArray.

I = gpuArray(imread('coins.png')); imshow(I)

Calculate gradient and display images.

[Gx, Gy] = imgradientxy(I); [Gmag, Gdir] = imgradient(Gx, Gy);

figure, imshow(Gmag, []), title('Gradient magnitude') figure, imshow(Gdir, []), title('Gradient direction')

figure, imshow(Gx, []), title('Directional gradient: X axis') figure, imshow(Gy, []), title('Directional gradient: Y axis')

Input Arguments

collapse all

I — Input imagegrayscale image | binary image

Input image, specified as a grayscale or binary image, that is, a numeric or logical 2-D matrix that must be nonsparse, or a gpuArray.

Data Types: single | double | int8 | int32 | uint8 | uint16 | uint32 | logical

gpuarrayI — Input imagegpuArray

Input image, specified as a 2-D grayscale or binary gpuArray image. Data Types: single | double | int8 | int32 | uint8 | uint16 | uint32 | logical

method — Gradient operator‘Sobel' (default) | ‘Prewitt' | 'CentralDifference' | 'IntermediateDifference' Gradient operator, specified as one of the text strings in the following table. Method Description ‘Sobel' Sobel gradient operator (default) ‘Prewitt' Prewitt gradient operator 'CentralDifference', Central difference gradient: dI/dx = (I(x+1)- I(x-1))/2 'IntermediateDifference' Intermediate difference gradient: dI/dx = I(x+1) - I(x) Data Types: char Output Arguments collapse all Gx — Directional gradients along x-axismatrix Directional gradient along the x-axis, returned as non-sparse matrix equal in size to image I. The x-axis points in the direction of increasing column subscripts. The output matrices are of class double, unless the input image is of class single, in which case they are of class single. When the input image I is a gpuArray, Gx is a gpuArray. Data Types: single | double gpuarrayGx — Directional gradients along

x-axisgpuArray

Directional gradient along the x-axis, returned as non-sparse gpuArray equal in size to image I. The x-axis points in the direction of increasing column subscripts. The output matrices are of class double, unless the input image is of class single, in which case they are of class single. Data Types: single | double

Gy — Directional gradient along they-axismatrix

Directional gradients along the y-axis, returned as non-sparse matrix equal in size to image I. The y-axis points in the direction of increasing row subscripts. The output matrices are of class double, unless the input image is of class single, in which case they are of class single. Data Types: single | double

gpuarrayGy — Directional gradient along

they-axisgpuArray

Directional gradients along the y-axis, returned as non-sparse gpuArray equal in size to image I. The y-axis points in the direction of increasing row subscripts. The output matrices are of class double, unless the input image is of class single, in which case they are of class single. Data Types: single | double


imgradientxy - 图文- .doc 将本文的Word文档下载到电脑
搜索更多关于: imgradientxy - 图文- 的文档
相关推荐
相关阅读
× 游客快捷下载通道(下载后可以自由复制和排版)

下载本文档需要支付 10

支付方式:

开通VIP包月会员 特价:29元/月

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:xuecool-com QQ:370150219