Answered step by step
Verified Expert Solution
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 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 display the image Princess using imagesc. Turn off the axis labels and make sure the pixels are square. Add a title 'Princess'.
Convert the 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 conv 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 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 conv 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 conv 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 and 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 D 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 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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started