用matlab 如何求一幅图像的梯度值呢,利用这个 [Ix,Iy]=gradient(I)为什么出现下面的错误呢? Error using ==> rdivideIntegers can only be combined with integers of the same class, or scalar doubles.Error in ==> gradient at 70
来源:学生作业帮助网 编辑:作业帮 时间:2024/06/22 02:39:32
![用matlab 如何求一幅图像的梯度值呢,利用这个 [Ix,Iy]=gradient(I)为什么出现下面的错误呢? Error using ==> rdivideIntegers can only be combined with integers of the same class, or scalar doubles.Error in ==> gradient at 70](/uploads/image/z/6607041-33-1.jpg?t=%E7%94%A8matlab+%E5%A6%82%E4%BD%95%E6%B1%82%E4%B8%80%E5%B9%85%E5%9B%BE%E5%83%8F%E7%9A%84%E6%A2%AF%E5%BA%A6%E5%80%BC%E5%91%A2%2C%E5%88%A9%E7%94%A8%E8%BF%99%E4%B8%AA+%5BIx%2CIy%5D%3Dgradient%28I%29%E4%B8%BA%E4%BB%80%E4%B9%88%E5%87%BA%E7%8E%B0%E4%B8%8B%E9%9D%A2%E7%9A%84%E9%94%99%E8%AF%AF%E5%91%A2%3F+Error+using+%3D%3D%3E+rdivideIntegers+can+only+be+combined+with+integers+of+the+same+class%2C+or+scalar+doubles.Error+in+%3D%3D%3E+gradient+at+70)
用matlab 如何求一幅图像的梯度值呢,利用这个 [Ix,Iy]=gradient(I)为什么出现下面的错误呢? Error using ==> rdivideIntegers can only be combined with integers of the same class, or scalar doubles.Error in ==> gradient at 70
用matlab 如何求一幅图像的梯度值呢,利用这个 [Ix,Iy]=gradient(I)为什么出现下面的错误呢
? Error using ==> rdivide
Integers can only be combined with integers of the same class, or scalar doubles.
Error in ==> gradient at 70
g(2:n-1,:) = (f(3:n,:)-f(1:n-2,:))./h(:,ones(p,1));
还是用别的函数来求梯度.
用matlab 如何求一幅图像的梯度值呢,利用这个 [Ix,Iy]=gradient(I)为什么出现下面的错误呢? Error using ==> rdivideIntegers can only be combined with integers of the same class, or scalar doubles.Error in ==> gradient at 70
>>a=imread('D:\Program Files\toolbox\images\imdemos\rice.png');
>> b=gradient(double(a));
转化图像为double型,即可,gradient中h(:,ones(p,1))估计是double,我转化后可以运行,得到的是水平方向的梯度.
>>[ax,ay]=gradient(double(a));可以得到水平和垂直方向的梯度.