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

  Relate the symbol rate to the null-to-null bandwidth

Provide an introduction to digital communications, and as a vehicle to introduce some of the features that are common to digital communication systems

  Solve a linear system of equations

Solves a linear system of equations using naïve Gaussian elimination - You can use the ‘backslash' Matlab operator for solving the systems of equations.

  Write additional syntax to create input variable named time

Write additional syntax to create an INPUT variable named time and prompt the user for the amount of time pedaling the bicycle (in hours).

  The train will be unsafe if the normal acceleration is

a train track is designed with a radius of 20 meters. the train will be unsafe if the normal acceleration is greater

  Plots the needle at a random position on the floor

EX1010 - Introduction to MATLAB Assignment, City University of London, UK. Plots the needle at a random position on the floor

  Write function that will receive three positive integers

Write a function is_pythag_triple that will receive three positive integers (a, b, c, in that order) and will return logical 1 (for true) or 0 (for false)

  It is now cooled so the volume becomes half the initial

a piston cylinder loaded so it gives constant pressure has 0.75 kg saturated vapor water at 200 kpa. it is now cooled

  Write a matlab function that takes in one argument

Write a MatLab function that takes in one argument, a vector or 2-D matrix and returns a single value, the highest value in the vector or matrix. Use nested for loops to accomplish this task. Assume that all of the values in the vector or matrix are ..

  Function that takes as input parameters a function

Define a function that takes as input parameters a function handle f, start, and end values a and b, and a number of steps n. The function should compute and return the average value of f over the range a to b.

  Write a matlab script to calculate the speed of the rocket

Write a MATLAB script to calculate the height (metres) and the speed (metres/s) of the rocket over flight-time. Plot these results against time using two graph.

  First ten numbers of the sequence of pseudorandom numbers

write a program that gives the first ten numbers of the sequence of pseudorandom numbers

  Finds the largest integer in the list recursively

Write a program that, given a list of 20 integers, finds the largest integer in the list recursively

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