Answered step by step
Verified Expert Solution
Question
1 Approved Answer
A Structural Engineering Professor needs to evalute the structural integrity of a damaged concrete shear wall. Several diagonal cracks formed in the wall surface as
A Structural Engineering Professor needs to evalute the structural integrity of a damaged concrete shear wall. Several diagonal cracks formed in the wall surface as a result of seismic forces. The cracks are annotated with sharpies and a picture is taken. The professor is interested in the red cracks and wants an image which just shows the red cracks. Create a filter with a threshold value to show only the red cracks.
Write a script which imports the image crackedwall.jpg and filter the image:
recall that a RGB color image is saved in Matlab as a n x m x matrix, where the red, green and blue channels are saved as n x m xn x m xn x m x respectively. imgray is the grayscale version of the image and it is saved as a n x m matrix. Plot the grayscale image imgray
calculate the imratio as the ratio of the red channel over the mean of the three channels, iedoubleimnm doubleimnm doubleimnm Plot the newly calculated image imratio. Convert the data type to double!
Hint: the resulting image should have a single channel it will be a grayscale image You may also have to convert your uint matrix into the datatype double before doing this.
create a mask imout to filter out parts of the image which are not red. The mask is a zero matrix is black with the only nonzero elements in correspondence of the red cracks. These elements are such that imratio threshold Create imout that only show pixels with imratio so that only the red cracks appear.
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