Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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 A x A 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.

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

Step: 3

blur-text-image

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

Seven NoSQL Databases In A Week Get Up And Running With The Fundamentals And Functionalities Of Seven Of The Most Popular NoSQL Databases

Authors: Aaron Ploetz ,Devram Kandhare ,Sudarshan Kadambi ,Xun Wu

1st Edition

1787288862, 978-1787288867

More Books

Students also viewed these Databases questions

Question

Distinguish between the roles of the SA node and AV node.

Answered: 1 week ago

Question

3. The group answers the questions.

Answered: 1 week ago