I am required to import the images using the imread function, covert it into grayscale and calculate the percentage forest area given the equation:
They specified that:
- Green (forest) in grayscale = 75 to 115 (inclusive)
- Light blue (water) in grayscale = 240
- Black (text) in grayscale = 0
- All other colours in grayscale represent land
I have imported the images and converted them into grayscale with the following code
yr_1950 = imread('1950.bmp');yr_1950 = rgb2gray(yr_1950);yr_1985 = imread('1985.bmp');yr_1985 = rgb2gray(yr_1985);yr_2000 = imread('2000.bmp');yr_2000 = rgb2gray(yr_2000);yr_2005 = imread('2005.bmp');yr_2005 = rgb2gray(yr_2005);yr_2010 = imread('2010.bmp');yr_2010 = rgb2gray(yr_2010);yr_2020 = imread('2020.bmp');yr_2020 = rgb2gray(yr_2020);
This is one of the images provided to me
I am unsure on how to calculate the forest area and total land area with the given information. Any help would be much appreciated.
Best Answer