1 00:00:00,938 --> 00:00:02,070 Hello, everybody. 2 00:00:02,070 --> 00:00:04,770 Welcome back to Remote Sensing Foundations. 3 00:00:04,770 --> 00:00:06,780 This week, we're gonna learn about some aspects 4 00:00:06,780 --> 00:00:08,160 of image processing. 5 00:00:08,160 --> 00:00:11,460 Specifically, we'll be discussing image restoration, 6 00:00:11,460 --> 00:00:14,883 image enhancement, and image compositing. 7 00:00:15,750 --> 00:00:17,940 At the end of the week, I hope that you'll understand 8 00:00:17,940 --> 00:00:20,580 how and why images are processed, 9 00:00:20,580 --> 00:00:24,840 how to interpret histograms of reflectance values, 10 00:00:24,840 --> 00:00:25,920 how to understand the difference 11 00:00:25,920 --> 00:00:29,190 between a composited and a raw image, 12 00:00:29,190 --> 00:00:31,481 and then finally, how to understand 13 00:00:31,481 --> 00:00:34,200 when you might use image masking. 14 00:00:34,200 --> 00:00:35,100 Let's get started. 15 00:00:36,960 --> 00:00:40,530 First, let's review some things that we learned last week. 16 00:00:40,530 --> 00:00:43,560 So, last week, we covered data types 17 00:00:43,560 --> 00:00:45,840 in GIS and remote sensing. 18 00:00:45,840 --> 00:00:48,870 So, we talked about the difference between vector data 19 00:00:48,870 --> 00:00:50,520 and raster data. 20 00:00:50,520 --> 00:00:52,020 We also covered the difference 21 00:00:52,020 --> 00:00:55,320 between extent and grain size. 22 00:00:55,320 --> 00:00:58,650 So, grain size is kind of similar to a pixel size, 23 00:00:58,650 --> 00:01:01,650 and extent is the entire area 24 00:01:01,650 --> 00:01:06,123 that you are capturing or measuring or studying. 25 00:01:07,230 --> 00:01:11,370 We also talked about band composites within images. 26 00:01:11,370 --> 00:01:15,270 So, images, they can have multiple different bands. 27 00:01:15,270 --> 00:01:18,690 And in order to visualize those bands as a color image, 28 00:01:18,690 --> 00:01:21,060 we use three different bands. 29 00:01:21,060 --> 00:01:24,990 Those bands could be red, green, and blue, 30 00:01:24,990 --> 00:01:27,600 which would make a true-color image. 31 00:01:27,600 --> 00:01:32,600 Or we can make a false color image by compositing 32 00:01:32,670 --> 00:01:35,187 bands that aren't the red, green, and blue band, 33 00:01:35,187 --> 00:01:38,430 and that can help us better interpret features 34 00:01:38,430 --> 00:01:39,483 on the landscape. 35 00:01:41,190 --> 00:01:44,190 Let's dive in and talk about image processing 36 00:01:44,190 --> 00:01:46,260 and what that entails. 37 00:01:46,260 --> 00:01:49,200 Digital image processing includes the steps that we take 38 00:01:49,200 --> 00:01:52,290 to turn satellite data into images. 39 00:01:52,290 --> 00:01:53,760 We're gonna talk about three aspects 40 00:01:53,760 --> 00:01:56,520 of image processing this week: image restoration, 41 00:01:56,520 --> 00:02:00,120 image enhancement, and image compositing. 42 00:02:00,120 --> 00:02:01,860 In future weeks, we're also gonna talk 43 00:02:01,860 --> 00:02:05,253 about image transformation and image classification. 44 00:02:06,270 --> 00:02:09,240 Broadly speaking, image restoration is concerned 45 00:02:09,240 --> 00:02:12,240 with the correction and calibration of images 46 00:02:12,240 --> 00:02:15,930 in order to achieve as faithful of representation 47 00:02:15,930 --> 00:02:18,630 of the Earth's surface as possible, 48 00:02:18,630 --> 00:02:21,840 which is a fundamental goal in remote sensing. 49 00:02:21,840 --> 00:02:26,070 Image enhancement is concerned with the modification 50 00:02:26,070 --> 00:02:30,660 of images to optimize their appearance to our eyes. 51 00:02:30,660 --> 00:02:33,390 So, this is really important in terms of making maps, 52 00:02:33,390 --> 00:02:36,010 because visual analysis is such a key element 53 00:02:38,190 --> 00:02:40,050 in remote sensing. 54 00:02:40,050 --> 00:02:42,930 And then, finally, image compositing is a way 55 00:02:42,930 --> 00:02:47,930 to correct images that have lost or undesirable information. 56 00:02:50,640 --> 00:02:53,520 There are two main types of image restoration, 57 00:02:53,520 --> 00:02:57,363 including radiometric restoration and geometric restoration. 58 00:02:58,230 --> 00:03:00,840 These kinds of restoration are usually referred to 59 00:03:00,840 --> 00:03:03,690 as image pre-processing, because they're done 60 00:03:03,690 --> 00:03:07,110 before doing any other sort of manipulation 61 00:03:07,110 --> 00:03:09,510 or analysis of images. 62 00:03:09,510 --> 00:03:13,320 We'll start off by talking about radiometric restoration, 63 00:03:13,320 --> 00:03:16,890 which is the process where we convert raw DNs 64 00:03:16,890 --> 00:03:19,620 received by the remote sensing sensor, 65 00:03:19,620 --> 00:03:24,183 and convert them into surface reflectance values. 66 00:03:26,070 --> 00:03:30,090 Radiometric restoration can also involve removing 67 00:03:30,090 --> 00:03:34,560 or diminishing distortions in the electromagnetic energy 68 00:03:34,560 --> 00:03:37,053 that is registered by each detector. 69 00:03:38,100 --> 00:03:40,320 I've shown on the right the general process 70 00:03:40,320 --> 00:03:43,950 that might happen in a satellite with satellite data 71 00:03:43,950 --> 00:03:48,950 to convert it from DNs to usable surface reflectance images. 72 00:03:49,800 --> 00:03:53,340 So, the sensor collects information as DNs, 73 00:03:53,340 --> 00:03:57,630 which are also referred to as digital numbers. 74 00:03:57,630 --> 00:03:59,970 And these numbers reflect the intensity 75 00:03:59,970 --> 00:04:01,953 of electromagnetic energy. 76 00:04:03,600 --> 00:04:07,050 DNs range from zero to some higher number, 77 00:04:07,050 --> 00:04:09,873 depending on the sensor's bit size. 78 00:04:11,430 --> 00:04:15,540 Sensors can usually automatically convert DNs to radiance, 79 00:04:15,540 --> 00:04:19,740 given rescaling factors that scientists or engineers 80 00:04:19,740 --> 00:04:21,393 will program into the sensor. 81 00:04:22,320 --> 00:04:25,474 Then, in order to convert sensor radiance 82 00:04:25,474 --> 00:04:27,720 to top-of-atmosphere reflectance, 83 00:04:27,720 --> 00:04:31,350 we have to use information like the Earth-sun distance, 84 00:04:31,350 --> 00:04:35,433 the solar zenith angle and the exo-atmospheric irradiance. 85 00:04:37,110 --> 00:04:41,760 Top-of-atmosphere Images are technically usable, 86 00:04:41,760 --> 00:04:44,970 but because they reflect the view from above the atmosphere, 87 00:04:44,970 --> 00:04:46,380 they can have distortions 88 00:04:46,380 --> 00:04:49,440 due to light scattering in the atmosphere, 89 00:04:49,440 --> 00:04:52,230 which is also called atmospheric haze. 90 00:04:52,230 --> 00:04:55,440 And you can see the effect of atmosphere haze 91 00:04:55,440 --> 00:04:58,650 in the top-of-atmosphere image 92 00:04:58,650 --> 00:05:01,950 at the bottom left of the slide; 93 00:05:01,950 --> 00:05:06,000 you can see that images with haze appear more washed out, 94 00:05:06,000 --> 00:05:08,433 and they don't have a high degree of contrast. 95 00:05:09,360 --> 00:05:11,100 We can correct for this haze 96 00:05:11,100 --> 00:05:14,050 and create surface reflectance images 97 00:05:15,630 --> 00:05:19,080 by having an understanding of atmospheric conditions 98 00:05:19,080 --> 00:05:21,813 when that satellite imagery was collected. 99 00:05:23,100 --> 00:05:25,350 There are also some other reasons 100 00:05:25,350 --> 00:05:28,470 why radiometric restoration is needed. 101 00:05:28,470 --> 00:05:32,700 For example, random noise, which is unpredictable 102 00:05:32,700 --> 00:05:36,000 or unsystematic performances of the sensor 103 00:05:36,000 --> 00:05:38,400 where certain pixels have randomly higher 104 00:05:38,400 --> 00:05:41,310 or lower values than they should. 105 00:05:41,310 --> 00:05:46,260 This can occur due to errors in the transmission of data. 106 00:05:46,260 --> 00:05:49,020 Striping is another radiometric error, 107 00:05:49,020 --> 00:05:53,520 and it's an error where lines in the image appear lighter 108 00:05:53,520 --> 00:05:55,230 or darker than they should, 109 00:05:55,230 --> 00:05:58,080 and this is due to a calibration issue 110 00:05:58,080 --> 00:06:00,450 caused by incorrect calibration 111 00:06:00,450 --> 00:06:03,150 of light detectors within the sensor. 112 00:06:03,150 --> 00:06:05,970 We'll talk more about random noise and striping 113 00:06:05,970 --> 00:06:08,700 and how we can correct those at the end of the presentation 114 00:06:08,700 --> 00:06:11,073 when I talk about image compositing. 115 00:06:12,660 --> 00:06:15,870 The other type of image pre-processing restoration 116 00:06:15,870 --> 00:06:18,750 is called geometric restoration. 117 00:06:18,750 --> 00:06:21,240 It's essential for any form of remotely-sensed imagery 118 00:06:21,240 --> 00:06:23,880 to be accurately geo-referenced. 119 00:06:23,880 --> 00:06:27,090 So, you register pixels with the correct coordinates, 120 00:06:27,090 --> 00:06:29,850 and then you can accurately line up rasters 121 00:06:29,850 --> 00:06:31,383 with features on the ground. 122 00:06:32,250 --> 00:06:36,180 There's a lot of reasons, however, why geometric errors 123 00:06:36,180 --> 00:06:38,340 or distortions occur. 124 00:06:38,340 --> 00:06:40,650 For example, satellites, 'cause they fly 125 00:06:40,650 --> 00:06:44,970 at such high altitudes, they have to consider details 126 00:06:44,970 --> 00:06:46,860 like how the curvature of the Earth 127 00:06:46,860 --> 00:06:51,860 and the rotation of the Earth can distort mapping of pixels. 128 00:06:53,220 --> 00:06:55,980 For aircraft that fly closer to the ground, 129 00:06:55,980 --> 00:06:57,720 they have a lot of other considerations, 130 00:06:57,720 --> 00:07:00,570 including relief displacement, 131 00:07:00,570 --> 00:07:03,390 which is when terrain elevation 132 00:07:03,390 --> 00:07:06,450 distorts their view of the ground. 133 00:07:06,450 --> 00:07:10,260 Variable topography can lead to a really irregular pattern 134 00:07:10,260 --> 00:07:13,323 of distortions, and it can be hard to remove. 135 00:07:14,160 --> 00:07:17,790 Small changes to the aircraft's speed and orientation 136 00:07:17,790 --> 00:07:19,500 can also affect imagery, 137 00:07:19,500 --> 00:07:21,423 like as shown in this bottom figure. 138 00:07:22,530 --> 00:07:26,010 For instance, if a super-strong wind hits the plane, 139 00:07:26,010 --> 00:07:28,350 you might have roll distortion; 140 00:07:28,350 --> 00:07:31,080 or if you don't fly in a perfectly straight line, 141 00:07:31,080 --> 00:07:33,123 you might have crab distortion. 142 00:07:34,140 --> 00:07:37,740 It's important to minimize geometric errors as possible 143 00:07:37,740 --> 00:07:40,530 when collecting remote sensing data, 144 00:07:40,530 --> 00:07:42,090 but you can see that some of these errors 145 00:07:42,090 --> 00:07:44,820 are inherent to the process. 146 00:07:44,820 --> 00:07:47,010 Therefore, scientists and engineers 147 00:07:47,010 --> 00:07:49,470 are really well-versed in using equations 148 00:07:49,470 --> 00:07:53,610 and resampling techniques to geometrically correct images, 149 00:07:53,610 --> 00:07:55,460 which I'll go over in the next slide. 150 00:07:57,480 --> 00:07:59,220 An important place to begin 151 00:07:59,220 --> 00:08:01,320 with the geometric correction process 152 00:08:01,320 --> 00:08:05,490 is using ground control points, or GCPs. 153 00:08:05,490 --> 00:08:07,830 Ground control points are points or features 154 00:08:07,830 --> 00:08:09,480 on the Earth's surface 155 00:08:09,480 --> 00:08:11,520 that you know the coordinates for. 156 00:08:11,520 --> 00:08:14,790 So, those should be features that never change location. 157 00:08:14,790 --> 00:08:19,790 For example, you could use buildings or islands or lakes. 158 00:08:20,040 --> 00:08:23,550 Scientists can find several ground control points 159 00:08:23,550 --> 00:08:26,370 in their imagery, and this will help them map out 160 00:08:26,370 --> 00:08:29,583 the coordinates of all of the pixels in their image. 161 00:08:30,810 --> 00:08:32,250 When we have pixel sizes 162 00:08:32,250 --> 00:08:34,590 or orientations that we have to correct, 163 00:08:34,590 --> 00:08:37,470 we use a process called resampling. 164 00:08:37,470 --> 00:08:41,310 And resampling basically involves generating equations 165 00:08:41,310 --> 00:08:43,980 that equate the ground control points 166 00:08:43,980 --> 00:08:47,310 on the distorted image with where they are 167 00:08:47,310 --> 00:08:49,290 on the corrected image, and then applying 168 00:08:49,290 --> 00:08:52,320 those same equations to the remaining pixels 169 00:08:52,320 --> 00:08:54,213 to correct the entire image. 170 00:08:55,050 --> 00:08:58,029 An important part of resampling is calculating 171 00:08:58,029 --> 00:09:01,713 new pixel values from the old pixel values. 172 00:09:02,550 --> 00:09:05,100 And there's three types of resampling methods 173 00:09:05,100 --> 00:09:06,810 that I'll bring up here. 174 00:09:06,810 --> 00:09:09,600 Those are the nearest-neighbor method, 175 00:09:09,600 --> 00:09:11,670 the bilinear interpolation method, 176 00:09:11,670 --> 00:09:14,223 and the bi-cubic interpolation method. 177 00:09:15,060 --> 00:09:17,820 These are good methods to know and understand 178 00:09:17,820 --> 00:09:21,450 for other types of processing and data manipulation 179 00:09:21,450 --> 00:09:23,373 that we'll cover later in the course. 180 00:09:24,390 --> 00:09:27,120 In the nearest-neighbor resampling method, 181 00:09:27,120 --> 00:09:30,270 the new pixel value will be equal to the value 182 00:09:30,270 --> 00:09:35,270 of the closest or most overlapping old pixel. 183 00:09:35,370 --> 00:09:37,980 Advantages of the nearest-neighbor method 184 00:09:37,980 --> 00:09:40,470 is that it's pretty simple to implement, 185 00:09:40,470 --> 00:09:43,700 but one disadvantage is that the features 186 00:09:43,700 --> 00:09:47,520 in the output image could potentially be offset 187 00:09:47,520 --> 00:09:50,610 by around one half pixel. 188 00:09:50,610 --> 00:09:54,480 And this can cause a disjointed or blocky appearance 189 00:09:54,480 --> 00:09:55,900 in the new image 190 00:09:57,952 --> 00:10:01,230 Bilinear interpolation is where the value 191 00:10:01,230 --> 00:10:05,520 of the new pixel is equal to the distance-weighted average 192 00:10:05,520 --> 00:10:08,760 of the four nearest pixels. 193 00:10:08,760 --> 00:10:11,190 This gives a smoother image appearance 194 00:10:11,190 --> 00:10:13,383 than the nearest-neighbor method, 195 00:10:15,690 --> 00:10:17,580 but you can get new pixel values 196 00:10:17,580 --> 00:10:19,950 that you didn't have before. 197 00:10:19,950 --> 00:10:23,280 And then, finally, in the bicubic interpolation method, 198 00:10:23,280 --> 00:10:25,650 your new pixel value will be the average 199 00:10:25,650 --> 00:10:29,400 of the 16 nearest pixels. 200 00:10:29,400 --> 00:10:32,370 This also leads to images that are smoother in appearance 201 00:10:32,370 --> 00:10:34,290 than the nearest-neighbor method, 202 00:10:34,290 --> 00:10:37,560 and potentially even a little bit smoother 203 00:10:37,560 --> 00:10:40,083 than the bilinear interpolation method. 204 00:10:41,910 --> 00:10:44,340 Again, there are trade-offs between these methods. 205 00:10:44,340 --> 00:10:46,800 For example, you have to be really careful 206 00:10:46,800 --> 00:10:50,520 of using the bilinear and bicubic interpolation methods 207 00:10:50,520 --> 00:10:52,950 when you're working with categorical data. 208 00:10:52,950 --> 00:10:56,850 So, if you have a map where 1 represents forest 209 00:10:56,850 --> 00:10:58,980 and 2 represents agriculture, 210 00:10:58,980 --> 00:11:01,440 if you use the bilinear method, 211 00:11:01,440 --> 00:11:05,490 you could get resampled pixel values of 1.5, 212 00:11:05,490 --> 00:11:08,010 which would obviously be meaningless 213 00:11:08,010 --> 00:11:09,990 and might sort of break your code. 214 00:11:09,990 --> 00:11:13,710 So, therefore you wanna use the nearest-neighbor method 215 00:11:13,710 --> 00:11:17,193 when you're working with categorical or non-continuous data. 216 00:11:19,770 --> 00:11:22,620 I now wanted to give a little bit of context 217 00:11:22,620 --> 00:11:24,660 about different Landsat collections 218 00:11:24,660 --> 00:11:28,380 that you may find within Google Earth Engine, 219 00:11:28,380 --> 00:11:31,170 'cause if you type in Landsat 8, 220 00:11:31,170 --> 00:11:33,960 you'll see that there's a lot of options to choose from, 221 00:11:33,960 --> 00:11:35,940 and this can be a bit confusing. 222 00:11:35,940 --> 00:11:39,990 So, I wanted to lay this out here, 223 00:11:39,990 --> 00:11:43,080 and it helps that we've gone over the radiometric 224 00:11:43,080 --> 00:11:45,333 and geometric correction processes. 225 00:11:46,740 --> 00:11:49,860 Because, for example, one of the Landsat collections 226 00:11:49,860 --> 00:11:53,340 that you might come across is called raw images. 227 00:11:53,340 --> 00:11:55,560 So, raw images basically means 228 00:11:55,560 --> 00:11:57,780 that it has not been 229 00:11:57,780 --> 00:12:02,780 radiometrically, or perhaps even geometrically corrected. 230 00:12:03,870 --> 00:12:07,470 And then, you have top-of-atmosphere collections, 231 00:12:07,470 --> 00:12:11,820 which, as we explained, represents the reflectance values 232 00:12:11,820 --> 00:12:14,580 at the top-of-atmosphere. 233 00:12:14,580 --> 00:12:17,790 And so, those might include a bit of haze, 234 00:12:17,790 --> 00:12:20,160 and they might be a little bit more washed out 235 00:12:20,160 --> 00:12:24,720 than the Earth was at that time. 236 00:12:24,720 --> 00:12:27,720 And then, finally, surface reflectance collections; 237 00:12:27,720 --> 00:12:30,360 that is after it has been 238 00:12:30,360 --> 00:12:33,030 completely radiometrically corrected, 239 00:12:33,030 --> 00:12:38,030 and that represents the reflectance values of the surface. 240 00:12:38,340 --> 00:12:40,470 And then, the Landsat collections, 241 00:12:40,470 --> 00:12:43,860 they also have tiers associated with them. 242 00:12:43,860 --> 00:12:45,690 So, they have Tier 1, Tier 2, 243 00:12:45,690 --> 00:12:49,050 and then you might also see real-time. 244 00:12:49,050 --> 00:12:54,050 So, real-time means that that data was just brought in, 245 00:12:55,950 --> 00:13:00,950 and they haven't checked it yet for potential errors. 246 00:13:00,990 --> 00:13:04,650 Tier 1 is the best quality, and Tier 2 means 247 00:13:04,650 --> 00:13:07,650 that there are some errors within that data 248 00:13:07,650 --> 00:13:10,800 that meant that that data didn't meet 249 00:13:10,800 --> 00:13:13,830 the accuracy standards for Tier 1. 250 00:13:13,830 --> 00:13:16,890 So, as you can see, there's sort of, as you go to the left 251 00:13:16,890 --> 00:13:20,400 of the screen, an increase in image quality. 252 00:13:20,400 --> 00:13:23,520 So, when you're looking at Landsat collections to use, 253 00:13:23,520 --> 00:13:25,650 definitely look for Tier 1, 254 00:13:25,650 --> 00:13:29,790 and I'd recommend using the surface reflectance collections. 255 00:13:29,790 --> 00:13:32,640 The top-of-atmosphere can also work, 256 00:13:32,640 --> 00:13:34,443 but you have to be aware of haze. 257 00:13:36,450 --> 00:13:39,690 We'll now talk about image enhancement. 258 00:13:39,690 --> 00:13:42,270 Image enhancement is concerned with the modification 259 00:13:42,270 --> 00:13:43,830 of images to make them more suited 260 00:13:43,830 --> 00:13:46,920 to the vision capabilities of the human eye. 261 00:13:46,920 --> 00:13:48,750 This is important because visual analysis 262 00:13:48,750 --> 00:13:52,230 plays a really strong role in all aspects of remote sensing, 263 00:13:52,230 --> 00:13:53,970 meaning that we judge and interpret 264 00:13:53,970 --> 00:13:57,720 and even classify images just by looking at them. 265 00:13:57,720 --> 00:13:59,370 Image enhancement techniques 266 00:13:59,370 --> 00:14:01,677 can take a lot of different shapes depending on your image 267 00:14:01,677 --> 00:14:03,690 and your question. 268 00:14:03,690 --> 00:14:05,880 I'm gonna concentrate today on talking 269 00:14:05,880 --> 00:14:09,270 about contrast stretching, which is a technique used 270 00:14:09,270 --> 00:14:11,670 to increase the visual distinction 271 00:14:11,670 --> 00:14:14,130 between features in an image. 272 00:14:14,130 --> 00:14:15,630 Contrast stretching is important 273 00:14:15,630 --> 00:14:18,810 because, even though digital sensors have a wide range 274 00:14:18,810 --> 00:14:21,180 of reflectance values that they can measure, 275 00:14:21,180 --> 00:14:24,690 some environments have a really narrow range of values 276 00:14:24,690 --> 00:14:27,360 that they reflect, and therefore images 277 00:14:27,360 --> 00:14:29,070 of those environments could appear 278 00:14:29,070 --> 00:14:31,080 quite dark or washed out. 279 00:14:31,080 --> 00:14:32,730 Through contrast stretching, 280 00:14:32,730 --> 00:14:35,820 we can stretch the reflectance values in those images 281 00:14:35,820 --> 00:14:37,923 and hopefully see more detail. 282 00:14:39,480 --> 00:14:44,480 The figure in the bottom left of the screen 283 00:14:44,670 --> 00:14:49,110 shows a Landsat image displaying the visible red band 284 00:14:49,110 --> 00:14:52,770 in grayscale, with its related histogram below it. 285 00:14:52,770 --> 00:14:54,420 Note that this image is really dark, 286 00:14:54,420 --> 00:14:56,430 and the reflectance values in the histogram 287 00:14:56,430 --> 00:14:58,950 are quite skewed to the left. 288 00:14:58,950 --> 00:15:02,340 The right panel of the figure shows the same image 289 00:15:02,340 --> 00:15:05,490 after a linear stretch has been applied. 290 00:15:05,490 --> 00:15:07,260 And you can see that there's a lot more detail 291 00:15:07,260 --> 00:15:10,080 in the landscape that you can see now. 292 00:15:10,080 --> 00:15:13,710 So, why do we care about histograms in remote sensing? 293 00:15:13,710 --> 00:15:16,230 Histograms provide a lot of information on images 294 00:15:16,230 --> 00:15:19,710 without having to even look at the images themselves. 295 00:15:19,710 --> 00:15:21,840 For example, you can pick out the presence 296 00:15:21,840 --> 00:15:23,910 or absence of features 297 00:15:23,910 --> 00:15:26,103 and the distribution of those features. 298 00:15:27,120 --> 00:15:29,910 Some histogram shapes for image 299 00:15:29,910 --> 00:15:33,780 include normal, skewed, bimodal, uniform. 300 00:15:33,780 --> 00:15:35,670 You can see those shapes 301 00:15:35,670 --> 00:15:38,220 in the figure at the right of the screen. 302 00:15:38,220 --> 00:15:41,130 And within these different histogram distributions, 303 00:15:41,130 --> 00:15:46,130 you can gather information about the images themselves. 304 00:15:46,770 --> 00:15:48,330 For example, you can tell a little bit 305 00:15:48,330 --> 00:15:50,040 about what's going on. 306 00:15:50,040 --> 00:15:52,590 For instance, an image that has lots of water 307 00:15:52,590 --> 00:15:56,580 and lots of clouds might have a bimodal distribution, 308 00:15:56,580 --> 00:15:58,770 because water has low reflectance values, 309 00:15:58,770 --> 00:16:01,233 and clouds have high reflectance values. 310 00:16:02,190 --> 00:16:05,640 Histograms can also be helpful in image classification 311 00:16:05,640 --> 00:16:07,320 and image segmentation, 312 00:16:07,320 --> 00:16:09,220 which we'll cover later in the course. 313 00:16:11,610 --> 00:16:13,830 Here are a few more examples of images 314 00:16:13,830 --> 00:16:16,320 and their associated histograms. 315 00:16:16,320 --> 00:16:19,110 And as you can see, the shapes of the histograms 316 00:16:19,110 --> 00:16:21,750 reflect what's going on in the image. 317 00:16:21,750 --> 00:16:24,630 For example, normally distributed histograms 318 00:16:24,630 --> 00:16:27,450 mean that the histogram is balanced, 319 00:16:27,450 --> 00:16:29,520 or that there is approximately similar numbers 320 00:16:29,520 --> 00:16:31,350 of low reflectance values 321 00:16:31,350 --> 00:16:33,570 and high reflectance values on either side 322 00:16:33,570 --> 00:16:35,790 of the histogram's peak. 323 00:16:35,790 --> 00:16:37,410 A normally distributed histogram 324 00:16:37,410 --> 00:16:40,560 that has a wide range of reflectance values, 325 00:16:40,560 --> 00:16:43,620 like the histogram on the far left of this figure, 326 00:16:43,620 --> 00:16:45,750 means that the image has good contrast, 327 00:16:45,750 --> 00:16:50,280 and likely has a good visual distinction between features. 328 00:16:50,280 --> 00:16:52,680 If the histogram is normal 329 00:16:52,680 --> 00:16:56,670 but narrow, this may mean that the image has low contrast. 330 00:16:56,670 --> 00:17:01,080 So, again, you can see in this, the image associated 331 00:17:01,080 --> 00:17:03,240 with a narrow histogram here is quite dark, 332 00:17:03,240 --> 00:17:05,100 and you can't see differences 333 00:17:05,100 --> 00:17:07,413 between features on the landscape very well. 334 00:17:08,430 --> 00:17:10,320 You can also see a skewed histogram here, 335 00:17:10,320 --> 00:17:12,720 meaning that the histogram isn't balanced, 336 00:17:12,720 --> 00:17:15,900 or the peak isn't in the middle of the distribution. 337 00:17:15,900 --> 00:17:20,130 For example, this histogram is negatively skewed, 338 00:17:20,130 --> 00:17:25,130 meaning that, on the left side of the peak of the histogram, 339 00:17:26,160 --> 00:17:29,430 there's more reflectance values than there is 340 00:17:29,430 --> 00:17:33,063 on the right side of the peak of the histogram. 341 00:17:33,930 --> 00:17:37,230 And then, finally, we can see a bimodal histogram here 342 00:17:37,230 --> 00:17:39,540 and its associated image. 343 00:17:39,540 --> 00:17:43,140 In this case, this bimodal histogram is made up 344 00:17:43,140 --> 00:17:47,270 of a normal distribution with an additional peak of values 345 00:17:47,270 --> 00:17:49,710 in the low reflectance range. 346 00:17:49,710 --> 00:17:54,690 So, the right peak, the normally distributed histogram 347 00:17:54,690 --> 00:17:55,800 in this image, represents 348 00:17:55,800 --> 00:17:58,680 the reflectance values of the land. 349 00:17:58,680 --> 00:18:00,630 And then, that left peak of values 350 00:18:00,630 --> 00:18:04,350 represents the reflectance values of the water. 351 00:18:04,350 --> 00:18:06,540 So, if you didn't see the images here 352 00:18:06,540 --> 00:18:09,480 and you only saw the histograms, 353 00:18:09,480 --> 00:18:12,840 you can see that you can kind of tell what's going on 354 00:18:12,840 --> 00:18:15,340 in the images, or at least you could make a guess. 355 00:18:18,510 --> 00:18:20,580 The last image processing method 356 00:18:20,580 --> 00:18:23,640 that we'll talk about today is image compositing. 357 00:18:23,640 --> 00:18:25,290 We can talk about composites in a couple 358 00:18:25,290 --> 00:18:26,820 of different ways in remote sensing, 359 00:18:26,820 --> 00:18:29,190 but for right now, let's just stick to the generation 360 00:18:29,190 --> 00:18:32,700 of composites for visual analysis. 361 00:18:32,700 --> 00:18:35,460 We already talked last week about band compositing, 362 00:18:35,460 --> 00:18:37,560 or selecting three bands in an image 363 00:18:37,560 --> 00:18:40,440 to make a color image. 364 00:18:40,440 --> 00:18:42,390 This, week we're gonna talk about the application 365 00:18:42,390 --> 00:18:46,050 of image compositing to fill gaps in your image. 366 00:18:46,050 --> 00:18:47,880 So, first off, there's a variety of reasons 367 00:18:47,880 --> 00:18:50,370 that there may be gaps in your image. 368 00:18:50,370 --> 00:18:51,510 I've shown some of these reasons 369 00:18:51,510 --> 00:18:53,280 at the right of this screen. 370 00:18:53,280 --> 00:18:56,280 For example, line drops, bit errors, and striping 371 00:18:56,280 --> 00:18:59,070 are all radiometric errors that can occur 372 00:18:59,070 --> 00:19:01,080 due to transmission errors 373 00:19:01,080 --> 00:19:03,873 or calibration issues within your sensor. 374 00:19:05,250 --> 00:19:08,550 Atmospheric interferences like clouds or smoke 375 00:19:08,550 --> 00:19:11,070 from volcanic eruptions are also reasons 376 00:19:11,070 --> 00:19:13,680 that you may wanna make an image composite, 377 00:19:13,680 --> 00:19:16,380 'cause they obstruct your view of the Earth's surface. 378 00:19:17,490 --> 00:19:20,130 All right, in order to correct these images 379 00:19:20,130 --> 00:19:22,740 or to make images that don't have errors, 380 00:19:22,740 --> 00:19:26,370 we typically start off by making a temporal composite, 381 00:19:26,370 --> 00:19:27,930 which just means that you have an image 382 00:19:27,930 --> 00:19:31,773 composed of pixels from two or more time periods. 383 00:19:33,000 --> 00:19:36,060 One super way that you can make a temporal composite 384 00:19:36,060 --> 00:19:40,470 is by taking one original image that has errors, 385 00:19:40,470 --> 00:19:42,540 identifying those problem pixels, 386 00:19:42,540 --> 00:19:46,410 and then replacing the pixels with pixels from another image 387 00:19:46,410 --> 00:19:49,293 that is close in time to the original image. 388 00:19:50,190 --> 00:19:53,640 Alternatively, we could build a new error-free image 389 00:19:53,640 --> 00:19:57,000 by making a stack of images of the same location 390 00:19:57,000 --> 00:20:01,260 through time, and then using pixel resampling methods. 391 00:20:01,260 --> 00:20:04,020 Again, there's a lot of different pixel resampling methods 392 00:20:04,020 --> 00:20:05,760 that we can choose from. 393 00:20:05,760 --> 00:20:07,410 I'll just talk about three different ways. 394 00:20:07,410 --> 00:20:10,980 So, first, we can average all the pixel values 395 00:20:10,980 --> 00:20:14,343 of a certain confidence interval through time. 396 00:20:15,660 --> 00:20:18,510 Second, we could take the median pixel value 397 00:20:18,510 --> 00:20:21,960 of the image stack, and that usually gets rid of clouds, 398 00:20:21,960 --> 00:20:25,890 because clouds have really high reflectance values. 399 00:20:25,890 --> 00:20:29,460 Or another way is that we could write some fancy code 400 00:20:29,460 --> 00:20:33,090 to identify and exclude problem areas in the image, 401 00:20:33,090 --> 00:20:37,110 and then only include pixels that meet certain thresholds. 402 00:20:37,110 --> 00:20:39,360 So, I've had to use this technique before 403 00:20:39,360 --> 00:20:41,970 when studying areas in Latin America 404 00:20:41,970 --> 00:20:46,413 that have cloud cover for over half of the time. 405 00:20:49,950 --> 00:20:52,620 I wanted to tell you about a famous line-drop issue 406 00:20:52,620 --> 00:20:54,990 with one of the Landsat satellites. 407 00:20:54,990 --> 00:20:59,340 So, on May 31st, 2003, the scan line corrector 408 00:20:59,340 --> 00:21:01,410 of Landsat 7 failed. 409 00:21:01,410 --> 00:21:04,260 And ever since then, the outputs from Landsat 7 410 00:21:04,260 --> 00:21:07,530 have had line drops, and the images appear stripey, 411 00:21:07,530 --> 00:21:08,970 as you can see. 412 00:21:08,970 --> 00:21:12,060 So, what the scan line corrector does is that it compensates 413 00:21:12,060 --> 00:21:15,300 for the forward movement of the satellite. 414 00:21:15,300 --> 00:21:17,130 In other words, as the satellite moves, 415 00:21:17,130 --> 00:21:20,070 it does so with a slight zigzag motion 416 00:21:20,070 --> 00:21:22,530 due to its momentum in space. 417 00:21:22,530 --> 00:21:24,540 And the scan line corrector is supposed 418 00:21:24,540 --> 00:21:27,030 to keep the image lines straight. 419 00:21:27,030 --> 00:21:29,610 But because it broke on Landsat 7, 420 00:21:29,610 --> 00:21:32,340 the image lines are now zigzaggy, 421 00:21:32,340 --> 00:21:35,310 and they lose a lot of data because of this. 422 00:21:35,310 --> 00:21:38,370 In fact, around 22% of the data is corrupted 423 00:21:38,370 --> 00:21:39,780 from this satellite. 424 00:21:39,780 --> 00:21:42,270 So, if you use images from Landsat 7 425 00:21:42,270 --> 00:21:43,890 in Google Earth Engine, 426 00:21:43,890 --> 00:21:46,410 you'll likely see this striping in the image, 427 00:21:46,410 --> 00:21:47,523 and now you know why. 428 00:21:48,660 --> 00:21:52,230 The images from Landsat 7 aren't totally unusable, though; 429 00:21:52,230 --> 00:21:55,323 we just have to use compositing to fill the gaps. 430 00:21:58,020 --> 00:22:01,290 Finally, I'd like to spend a minute talking about masking 431 00:22:01,290 --> 00:22:04,020 and how it relates to image compositing. 432 00:22:04,020 --> 00:22:07,350 Masking means that you exclude pixels from your analysis, 433 00:22:07,350 --> 00:22:09,480 or make them transparent. 434 00:22:09,480 --> 00:22:11,910 And again, things that we might want to mask 435 00:22:11,910 --> 00:22:15,870 include clouds or smoke, cloud shadows, 436 00:22:15,870 --> 00:22:18,000 shadows from mountains or buildings. 437 00:22:18,000 --> 00:22:19,740 You may also wanna mask out features 438 00:22:19,740 --> 00:22:22,530 like snow or ice in your image. 439 00:22:22,530 --> 00:22:24,720 And in image compositing, 440 00:22:24,720 --> 00:22:27,300 masking is important because it removes those pixels 441 00:22:27,300 --> 00:22:29,160 and allows that space to be filled 442 00:22:29,160 --> 00:22:32,010 with pixels from another image, 443 00:22:32,010 --> 00:22:37,010 or allows you to not do analyses over those pixels. 444 00:22:38,520 --> 00:22:40,050 So, again, masking can be important 445 00:22:40,050 --> 00:22:41,520 when you're analyzing images. 446 00:22:41,520 --> 00:22:43,470 So, for example, if you wanna know 447 00:22:43,470 --> 00:22:47,220 the mean reflectance value of vegetation in a park, 448 00:22:47,220 --> 00:22:49,740 you may wanna first mask out any streams 449 00:22:49,740 --> 00:22:53,670 or water features in that park so that they don't contribute 450 00:22:53,670 --> 00:22:55,773 to your answer and skew your data. 451 00:22:56,640 --> 00:22:59,490 A lot of the images that we use in Google Earth Image 452 00:22:59,490 --> 00:23:03,750 already have things like clouds masked out of them for us. 453 00:23:03,750 --> 00:23:05,340 But if you're working with raw imagery, 454 00:23:05,340 --> 00:23:08,310 you'll have to apply a mask yourself. 455 00:23:08,310 --> 00:23:10,260 This process is actually pretty simple 456 00:23:10,260 --> 00:23:11,610 to do in Google Earth Image, 457 00:23:11,610 --> 00:23:14,433 and you'll learn how to do it in the coming weeks.