Create an account Log In

Image/matrix shift (Scripts) 1.0

Average Rating
User Rating:
Visitors Rating:
My rating:

See full specifications

Image/matrix shift (Scripts) Publisher's description

normshift function- fast and efficient multi-dimensional and multi type, with only zero bound assumption

In short:
normshift function- fast and efficient multi-dimensional and multi type, with only zero bound assumption.

imshift- designated to be used with images. Capable to shift several images at once, user definable boundaries assumptions.

While sirchift is fast and all types and input dimentions supporting, is implies a circular signal, which in not always the case. See subplot 5- with skyвЂ™s coming out of the ground. Sometimes it is better to assume zero values outside the image bounds- see subplots 3,6. In this case my function normshift will be useful, as it is fast and supports all types of data.
When a user needs additional boundaries assumptions, he can use my imshift function, which is somewhat limited in supported inputs, and runs at slower pace, but it supports different types of boundaries types : 'symmetric', 'replicate'(subplot 2), 'circularвЂ™(subplot 4) and zero (subplot 3).

In detail:

%% function shiftedMat=normshift(inMat,shiftsize)
Efficiently shifts input matrix in a manner similar to Matlab circshift, with minimal value out of input matrix assumed.

%% Syntax
shiftedMat=normshift(inMat,shiftsize)

%% Description
This functions goal is to shift a matrix of any type and dimensions by user defined shiftsize. The functions is highly similar to Matlab build in circshift, but instead of assuming periodic matrix, it assumes a atrix with zero (actually minimal existing value) values outside input matrix bounds.

%% Input arguments:
inMat- an input matrix subject to the shift. Can be of any dimension and any type.

shiftsize- 1:N dimensional vector, where N is number of dimensions of inMat. Describes desired shift in each dimension. Naturally must be an integer. Positive and negative values are supported.

%% Output arguments
% The shifted variants of the input 1/2/3-Dimentional inputs

%% Example
img=imread('peppers.png');
figure; imshow(img); title('Original image');
figure; imshow(circshift(img,[20,-18])); title('Circ Shifted image- repetaive input is assumed');
figure; imshow(normshift(img,[20,-18])); title('Normal Shifted image- zero bounds are assumed');

%% See also
circshift; % Matlab function- a fast and all data types and dimensions supporting function. Note that in this case however that only 'circular' Boundary Option is possible.
imShift; % A custom function, operating only on images, with user defined Boundary Options

вЂѓ
%% function varargout=imshift(shiftVec,varargin)
Shifts input images, computing it via convolutions with shifted 2D delta function.

%% Syntax
[shiftImg1,shiftImg2,...]=imshift(shiftVec,shiftImg1,shiftImg2,...)
[shiftImg1,shiftImg2,...]=imshift(shiftVec,BoundaryOption,shiftImg1,shiftImg2,...)

%% Description
This functions goal is to shift image by user defined shiftVec. The shift is performed by convolution with appropriate delta function. User may choose Boundary Options in a manner similar to imfilter. The function receives an arbitral number of inputs to operate on- all will be shifted simultaneously by shiftVec.

%% Input arguments (defaults exist):
shift_coordinates- 1X2[rows,columns] vector. Describes the desired shift of rows and columns. Naturally must be an integer. Positive and negative values are supported.

Boundary Options- one of the following options {'symmetric', 'replicate', 'circular'} is supported. When no boundary option is specified, Input array values outside the bounds of the array are implicitly assumed to have 0 value (default).

% varargin- the input images subject to shift 2 or 3 dimensional inputs of any size. Each will result in an appropriate output. Function supports all types of inputs supported by imfilter- 2-D logical, UINT8, DOUBLE etc..., and 3-D UINT8, DOUBLE etc...

%% Output arguments
The shifted variants of the 1/2/3-Dimentional inputs

%% Issues & Comments
This functions utilizes the Matlab IMFILTER function, which allows multiple image data types support, and various Boundary Options. The drawback, is relatively slow performance, compared to circshift and normshift. In addition imshift is limited to 1-D,2-D and 3-D inputs.

%% Example
img=imread('peppers.png');
figure; imshow(img); title('Original image');
figure; imshow(imshift([20,18],img)); title('Shifted image- zero bounds');
figure; imshow(imshift([20,18],img,'symmetric')); title('Shifted image- mirror-reflecting bounds');

%% See also
imfilter; % Matlab Image processing function- see for supported types and Boundary Options

circshift; % Matlab function- a fast and all datatypes and dimentions supporting function. Note that in this case however that only 'circular' Boundary Option is possible.

normShift % A custom function, highly similar to circshift, but with ZERO Boundary Option

System Requirements:

MATLAB 7.12 (2011a)
Program Release Status: New Release
Program Install Support: Install and Uninstall

Image/matrix shift (Scripts) Tags:

Click on a tag to find related softwares

Is Image/matrix shift (Scripts) your software?

Manage your software

Most Popular

ASK, OOK, FSK, BPSK, QPSK, 8PSK modulation 1.1
ASK, OOK, FSK, BPSK, QPSK, 8PSK modulation contain several functions for digital modulation simulation
Simulink Communication Labs 1.1
Simulink Communication Labs allows you to learn communication systems in greater depth.
M-QAM modulation and demodulation 1.1
M-QAM modulation and demodulation is the QAM modulation and demodulation tech.
LZW Compression/Decompression 1.1
LZW Compression/Decompression - Updated LZW compressor and decompressor with reasonable performance
InSPIRE utility to plot a 2D displacement field (Scripts) 1.0
This program plots the deformation field (displace vectors) contained in vector.txt.