Create spatial transformation matrix

Assignment Help MATLAB Programming
Reference no: EM132582442

ENGI 7854 Image Processing and Applications - Memorial University of Newfoundland

Calculating the moment invariants

1. Download the grayscale test image (image.png), calculate moments.m, and Moment invariants.m files from D2L under Lab 4 and save them in the MATLAB working directory. Read the files and understand the implementation of calculating the seven invariant moments.

2. Read the image, obtain the size of the image and pad the image by one-fourth the image size in all directions with zeros. Use this as the basis for next steps (referred to as Im1 ).

3. Create spatial transformation matrix T1 for translation as follows:
T1 = maketform('affine', [1 0 0; 0 1 0; Xt Yt 1]);
%Xt,Ytareone-fourthofyouroriginalimage
Use the above transformation matrix T1 and perform the transformation as follows:
Im2 = imtransform(Im1, T,...
'XData',[1 size(Im1,1)],'YData',[1 size(Im1,2)]);
Display the translated image Im2;

4. Create spatial transformation matrix T2 for scaling to 0.5 (of original size) as follows:
T2 = maketform('affine', [0.5 0 0; 0 0.5 0; 0 0 1]);
Use the above transformation matrix T2 and perform the transformation as follows:
Im3 = imtransform(Im1, T2,...
'XData',[1 size(Im1,1)],'YData',[1 size(Im1,2)]);
Display the translated image Im3;

5. Create spatial transformation matrix T3 to rotate the image by 45 degrees as follows:
T3 = maketform('affine', [cos(pi/4) sin(pi/4) 0; -sin(pi/4) cos(pi/4)
0; 0 0 1]);
Use the above transformation matrix T3 and perform the transformation as follows:

Im4 = imtransform(Im1, T3,...
'XData',[-269 size(Im1,1)-270],'YData',[+111 size(Im1,2)+110]);
Display the translated image Im4;

6. Create spatial transformation matrix T4 for rotating the image 90 degrees as follows:
T4 = maketform('affine', [cos(pi/2) sin(pi/2) 0; -sin(pi/2) cos(pi/2)
0; 0 0 1]);
Use the above transformation matrix T4 and perform the transformation as follows:
Im5 = imtransform(Im1, T4,...
'XData',[-539 size(Im1,1)-540],'YData',[1 size(Im1,2)]);
Display the translated image Im5;

7. Flip the original image Im1 from left to right using following command and generate image Im6.
Im6=flipdim(Im1,2);
Display the mirrored image Im6;

8. The downloaded matlab file Moment invariant.m contains a function Moment invariant(), which calls to another function named as calculate moments. Collectively, these functions calculate the moment invariants.

Use the function Moment invariant() and pass the images created from step 2 to step 7 (Im1-Im6) from the command line. For example, the following line will display the moment invariants calculated for Im1:
Moment_invariants(Im1)

Discussion

1. You should include the MATLAB code and results in your lab report.

2. Discuss the values of the moment invariants computed for each image, including any similarities or differences. What do these similiarities or differences mean in terms of image features?

Attachment:- Image Processing and Applications.rar

Reference no: EM132582442

Questions Cloud

Identify the reaction-hydrolysis reaction : Identify the following reaction: Glucose +Fructose ±Sucrose +Water
What percentage of the f2 generation will be only blue : All of the F1 offspring have blue and red spots. If you take two of these F1 offspring and cross them, what percentage of the F2 generation will be only blue?
How have adaptations allowed plants : How have adaptations allowed plants to move from an aquatic environment to the variety of habitats they have now
Prepare a trial balance as of the end of june : Prepare general journal entries to record these transactions using the following titles: Cash (101); Accounts Receivable (106); Prepaid Insurance
Create spatial transformation matrix : Calculating the moment invariants and Create spatial transformation matrix T4 for rotating the image - which calls to another function named
Why is oxygen necessary for aerobic respiration : Why is oxygen necessary for aerobic respiration?
Different societies have different social structures : Different societies have different social structures. What components contribute to the macrosociological perspective of social structure?
Identify two other parties that could have played vital role : Identify two other parties that could have played vital roles in upholding the integrity of financial reporting at Polo Incorporation Berhad? Justify answer
Strategic competitiveness : From the first e-Activity, determine which of the two primary drivers of the competitive landscape is more influential. Explain your rationale.

Reviews

Write a Review

MATLAB Programming Questions & Answers

  Finite difference method

Use the finite difference method to calculate the temperature at the point specified since it is easier.

  Determine the necessary shell temperature

In a shell-and-tube heat exchanger, one fluid passes through a central tube while another fluid flows through an outer shell in the opposite direction. The purpose is to heat the fluid passing through the central tube.

  Find the integral of a function at an arbitrary location

Write a Matlab function to perform numerical integration of a set of evenly spaced data points using the trapezoidal rule

  Compute the speed of single-stage planetary gear train

Write a MATLAB function [speed] = planetary (N, emesh, first, last, arm) that computes the speed of a given link in a single-stage planetary gear train.

  Calculate and plot the error in the numerical derivative

Write a program to calculate and plot the error in the numerical estimate of the derivative.

  Create the graph using matlab functions

Create the graph, which contains a piecewise function where a line exists in the first interval, a parabola in the second interval, and the sine function in the third interval.

  Develop a simulation program

Develop a simulation program

  Create a vector in matlab

Create a three dimensional diagram of function.

  Open a named pipe and to read data from the pipe

Open a named pipe and to read data from the pipe in matlab

  Write the commands that will create the matrix

Write the commands that will create the matrix.

  Lagrange interpolating polynomial of degree

Lagrange interpolating polynomial of degree

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd