v = directionalVariogram(img, xoffset, yoffset); in which version of matlab this function is suported? also in which toolbox?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
v = directionalVariogram(img, xoffset, yoffset);
in which version of matlab this function is suported?
also in which toolbox?
0 Kommentare
Akzeptierte Antwort
Wayne King
am 24 Dez. 2012
Bearbeitet: Wayne King
am 24 Dez. 2012
This is not a MathWorks' function. It was a function written and posted by Daniel Young as far as I can tell
function v = directionalVariogram(img, xoffset, yoffset)
%directionalVariogram computes empirical direction variogram
% v = directionalVariogram(img, xoffset, yoffset) takes a 2D image array
% and offsets in the x and y directions. It returns the mean of the
% squared differences between pairs of pixels in the image such that the
% spatial offsets between the pixels are as specified.
if xoffset < 0 % difference is symmetric so can force xoffset positive
xoffset = -xoffset;
yoffset = -yoffset;
end
% make offset and trimmed copies of image
if yoffset > 0
imga = img(1+yoffset:end, 1+xoffset:end);
imgb = img(1:end-yoffset, 1:end-xoffset);
else
imga = img(1:end+yoffset, 1+xoffset:end);
imgb = img(1-yoffset:end, 1:end-xoffset);
end
d = imga - imgb;
v = mean(d(:).^2);
end
To see Daniel's original answer:
3 Kommentare
Wayne King
am 24 Dez. 2012
That is also not a MathWorks' function, but perhaps you are talking about this?
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Image Processing Toolbox finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!