diff options
Diffstat (limited to 'SD-VBS/benchmarks/texture_synthesis/src/matlab/shift.m')
| -rwxr-xr-x | SD-VBS/benchmarks/texture_synthesis/src/matlab/shift.m | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/SD-VBS/benchmarks/texture_synthesis/src/matlab/shift.m b/SD-VBS/benchmarks/texture_synthesis/src/matlab/shift.m deleted file mode 100755 index 497297e..0000000 --- a/SD-VBS/benchmarks/texture_synthesis/src/matlab/shift.m +++ /dev/null | |||
| @@ -1,15 +0,0 @@ | |||
| 1 | % [RES] = shift(MTX, OFFSET) | ||
| 2 | % | ||
| 3 | % Circular shift 2D matrix samples by OFFSET (a [Y,X] 2-vector), | ||
| 4 | % such that RES(POS) = MTX(POS-OFFSET). | ||
| 5 | |||
| 6 | function res = shift(mtx, offset) | ||
| 7 | |||
| 8 | dims = size(mtx); | ||
| 9 | |||
| 10 | offset = mod(-offset,dims); | ||
| 11 | |||
| 12 | res = [ mtx(offset(1)+1:dims(1), offset(2)+1:dims(2)), ... | ||
| 13 | mtx(offset(1)+1:dims(1), 1:offset(2)); ... | ||
| 14 | mtx(1:offset(1), offset(2)+1:dims(2)), ... | ||
| 15 | mtx(1:offset(1), 1:offset(2)) ]; | ||
