Image processing. Simple transformations: translation, scaling rotation. Reading in images Logical arrays, masking Thresholding and bwlabel Immunoflourescence Application: Msh5 imaging during meiosis Applying some transformations to imaging data. Transformations.
1. Translation: involves simply shifting points in the plane.
We can achieve this by creating a matrix Tv which we use as an "translation operator".
We start by defining a matrix,
If the points we want to transform
are in the following (matrix) form:
Download the file “shapeCoords.m”. This is a function which returns a set of (x,y) points.
1. Write a function for scaling the shape by a scalar factor (i.e., vx=vy). Scale the shape by ½, then plot the new figure in green (using “hold on”).
2. Similarly, write a function for rotation. Rotate the figure by 90o and plot in blue.
r = imread(‘~/small.jpg');
a = [1 2 3; 5 6 7; 7 8 9];
b = a>5;
c = logical(a)
c = c+0
a(b) = sqrt(a(b))
a(a>5) = sqrt(a(a>5))
x = eye(8);
x = ~( x|fliplr(x) );
y = bwlabel(x,4)
3. Individual objects can then be selected:
the objects in the image
and display using image().
Save the results as
a PDF file.