Question: 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 (cracked_wall.jpg) and filter the image:
recall that a RGB color image is saved in Matlab as a (n x m x 3) matrix, where the red, green and blue channels are saved as (n x m x1),(n x m x2),(n x m x3), respectively. im_gray is the grayscale version of the image and it is saved as a (n x m) matrix. Plot the grayscale image im_gray
calculate the im_ratio as the ratio of the red channel over the mean of the three channels, i.e.,(double(im(n,m,1))+ double(im(n,m,2))+ double(im(n,m,3)))/3. Plot the newly calculated image im_ratio. (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 uint8() matrix into the datatype double() before doing this.
create a mask im_out to filter out parts of the image which are not red. The mask is a zero matrix (0 is black) with the only non-zero elements in correspondence of the red cracks. These elements are such that im_ratio > threshold =1.9. Create im_out that only show pixels with im_ratio >1.9 so that only the red cracks appear.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!