Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

matlab practice question The Princess Theatre in the Melbourne CBD is rumoured to be haunted by the ghost of Frederick Federici, an opera singer who

matlab practice question
The Princess Theatre in the Melbourne CBD is rumoured to be haunted by the ghost of Frederick
Federici, an opera singer who died of a heart attack during a performance of Faust in 1888. Even today,
a seat is always saved and left empty for Federici's ghost on each opening night of a new production.
An image featuring the Princess Theatre has been provided for this question as 'princess.jpeg'. Do the
following:
Use imread to read the image from the file 'princess.jpeg' and store it as a matrix named
Princess.
In Figure 1, display the image Princess using imagesc. Turn off the axis labels and make sure
the pixels are square. Add a title 'Princess'.
Convert the 3-channel colour image Princess to grayscale using the mean function. Store this
as a new matrix named GrayPrincess.
Create an AA averaging filter named f.
Use the conv2 function to apply the averaging filter f to the image GrayPrincess. Use the
'same' parameter during convolution, and store the result as a new matrix named
BlurPrincess.
Create a new matrix EdgePrincess that contains the edges of the Princess Theatre image, by
defining EdgePrincess as the absolute value (you may use the abs function) of the difference
between GrayPrincess and BlurPrincess.
In Figure 2, display the image EdgePrincess using imagesc. Turn off the axis labels, make the
colormap gray, and make sure the pixels are square. Add a title 'Edgy Princess'.
Create a horizontal edge detector named h, with the values given in B. Create a vertical edge detector named v, with the values given in C.
Use the conv2 function to apply the horizontal edge detector h to the image GrayPrincess.
Use the 'same' parameter during convolution, and store the result as a new matrix named
HPrincess.
Use the conv2 function to apply the vertical edge detector v to the image GrayPrincess. Use
the 'same' parameter during convolution, and store the result as a new matrix named
VPrincess.
Combine the horizontal and vertical edges, and store the result as a new matrix named
CombPrincess.
Use the rescale function to rescale the pixel intensities in CombPrincess to between 0 and 1,
and store the result as a new matrix named ResPrincess.
Create a new matrix NewPrincess that contains a version of the image ResPrincess in the
colour specified by D. That is, set ResPrincess as the appropriate two colour channels of a
new 3D matrix named NewPrincess, and set all intensities in the remaining colour channel to
zero (hint: recall that Red + Green = Yellow, Red + Blue = Magenta, and Blue + Green =
Cyan).
In Figure 3, display the image NewPrincess using imagesc. Turn off the axis labels and make
sure the pixels are square. Add a title 'Colourful Princess'. Note:
Use semicolons (; ) to suppress code output, or answers may not compute properly as the image
matrices are large.
You must use the variable names specified in the question (case is important).
DO NOT use any clear, clc, or close all commands in your script.
Image is given in transcript
A=[6]
B=[111; 000; -1-2-1]
C=[10-2; -20-1; 101]
D=Yellow
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Objects And Databases International Symposium Sophia Antipolis France June 13 2000 Revised Papers Lncs 1944

Authors: Klaus R. Dittrich ,Giovanna Guerrini ,Isabella Merlo ,Marta Oliva ,M. Elena Rodriguez

2001st Edition

3540416641, 978-3540416647

More Books

Students also viewed these Databases questions