Shift rows or columns of image by linearly varying offset
The GeometricShearer System object shifts the rows or columns of an image by a gradually increasing distance left or right or up or down.
H = vision.GeometricShearer creates a System object, H, that shifts the rows or columns of an image by gradually increasing distance left or right or up or down.
H = vision.GeometricShearer(Name,Value, ... 'NameN',ValueN) creates a geometric shear object, H, with each specified property set to the specified value.
Direction to apply offset
Specify the direction of linearly increasing the offset as one of Horizontal | Vertical. The default is Horizontal. Set this property to Horizontal to linearly increase the offset of the rows, or Vertical to linearly increase the offset of the columns.
Specify the size of the output image as one of Full | Same as input image. The default is Full. If you set this property to Full, the object outputs a matrix that contains the sheared image values. If you set this property to Same as input image, the object outputs a matrix that is the same size as the input image and contains a portion of the sheared image.
Source of shear values
Specify the source of shear values as one of Property | Input port. The default is Property.
Shear values in pixels
Specify the shear values as a two-element vector that represents the number of pixels by which to shift the first and last rows or columns of the input. The default is [0 3]. This property applies when you set the ValuesSource property to Property.
Maximum number of pixels by which to shear image
Specify the maximum number of pixels by which to shear the image as a real, numeric scalar. The default is 20. This property applies when you set the ValuesSource property to Input port.
Value of pixels outside image
Specify the value of pixels that are outside the image as a numeric scalar or a numeric vector that has the same length as the third dimension of the input image. The default is 0. This property is tunable.
Interpolation method used to shear image
Specify the interpolation method used to shear the image as on of Nearest neighbor | Bilinear | Bicubic. The default is Bilinear. When you set this property to Nearest neighbor, the object uses the value of one nearby pixel for the new pixel value. When you set this property to Bilinear, the object sets the new pixel value as the weighted average of the two nearest pixel values. When you set this property to Bicubic, the object sets the new pixel value as the weighted average of the four nearest pixel values.
|clone||Create a geometric shear object with same property values|
|getNumInputs||Number of expected inputs to step method|
|getNumOutputs||Number of outputs from step method|
|isLocked||Locked status for input attributes and non-tunable properties|
|release||Allow property value and input characteristics changes|
|step||Shift rows or columns of image by linearly varying offset|
Apply a horizontal shear to an image.
hshear = vision.GeometricShearer('Values',[0 20]); img = im2single(checkerboard); outimg = step(hshear,img); subplot(2,1,1), imshow(img); title('Original image'); subplot(2,1,2), imshow(outimg); title('Output image');
This object implements the algorithm, inputs, and outputs described on the Shear block reference page. The object properties correspond to the block parameters.