Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a script which imports the image ( cracked _ wall.jpg ) and filter the image: recall that a RGB color image is saved in

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 (nm3) matrix, where the red, green and blue channels are saved as
(n x m x 1),(n x m x2),(n x m x 3), 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 > thresho/d =1.9. Create im_out
that only show pixels with im_ratio >1.9 so that only the red cracks appear.
Hint: there will be other parts of the image that still shows. We call this noise and that is acceptable.
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

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

OpenStack Trove

Authors: Amrith Kumar, Douglas Shelley

1st Edition

1484212215, 9781484212219

More Books

Students also viewed these Databases questions

Question

2. What does the other person defi ne as the beginning?

Answered: 1 week ago

Question

1. What do you defi ne as the start of interaction?

Answered: 1 week ago