我使用下面的代碼來使用索貝爾掩模來掩蓋圖像。 for i=1:size(C,1)-2
for j=1:size(C,2)-2
%Sobel mask for x-direction:
Gx=((2*C(i+2,j+1)+C(i+2,j)+C(i+2,j+2))-(2*C(i,j+1)+C(i,j)+C(i,j+2)));
%Sobel mask for
試圖以外提取的像素和它自己的區域內的邊緣內,目前我正在申請的SciPy的Sobel濾波器是這樣的: im = scipy.misc.imread(filename)
im = im.astype('int32')
dx = ndimage.sobel(im, axis=0)
dy = ndimage.sobel(im, axis=1)
mag = np.hypot(dx, dy)
ma
opencv Sobel算子是否計算相關性,而不是卷積? 我知道filter2D函數計算相關性,我只是發現了(從代碼的結果爲基礎),其Sobel算子也計算的相關性。這是預期的嗎?我在這裏錯過了什麼? Mat sobelx, dest1,dest2;
Sobel(src, sobelx, src.depth(),1,0,3);
imshow("Sobel filtered in x dir" ,