/*Load a Landsat 8 image and select only the panchromatic band.
The panchromatic band includes reflectance in the 0.503–0.676 µm
wavelength range with a ground sample distance of 15 m. */varimage=ee.Image('LANDSAT/LC08/C01/T1/LC08_015030_20140307').select("B8");//Center map display on Syracuse with a zoom level of 12Map.setCenter(-76.1467,43.0458,12);//Display image as color infrared composite.Map.addLayer(image,'','inputimage');/* Perform Canny edge detection and display the result. This function uses the threshold parameter to determine the minimum gradient magnitude; the sigma parameter is the standard deviation (SD) of a Gaussian pre-filter to remove high-frequency noise. A sigma of 0 means apply no filtering.*/varcanny=ee.Algorithms.CannyEdgeDetector({image:image,threshold:200,sigma:1});//Display the outcome of the canny edge detection.Map.addLayer(canny,{},'canny');// Perform a Hough transform of the Canny result. In this function gridSize means size of grid for analysis (default is 256), inputThreshold is the value threshold for the input image (pixels at or above this value are considered active) and lineThreshold is the threshold for line detection (values at or above this threshold on the Hough transform are considered detected lines). Each of these parameters can be determined experimentally. The defaults provided in GEE for the parameters are intended as a starting point for use with unsigned 8-bit integers.varhough=ee.Algorithms.HoughTransform(canny,256,7000,80);//Display the outcome of the Hough transformed canny edge detection.Map.addLayer(hough,{},'hough');
Pan Sharpening using HSV space
// Import a Landsat 8 top-of-atmosphere reflectance image varimage=ee.Image('LANDSAT/LC08/C01/T1_TOA/LC08_015030_20140307');//Display image as normal color composite.Map.addLayer(image,{bands:['B4','B3','B2']},'RGBimage');// Convert the visible bands from the input image to HSV color space.varhsv=image.select(['B4','B3','B2']).rgbToHsv();/* Create a new image by concatenating the hue and saturation bands (HSV image) with the panchromatic band from the original image and converting back to RGB. *///Concatenate bandsvarcombined=ee.Image.cat([hsv.select('hue'),hsv.select('saturation'),image.select('B8')]);//Convert back to RGB spacevarsharpened=ee.Image(combined).hsvToRgb();//Set the map display to center at City of Syracuse and a zoom level of 14Map.setCenter(-76.14,43.04,14);// Display the pan-sharpened result.Map.addLayer(sharpened,'','pan-sharpened');
Performing visual interpretation through texture analysis
//Import a high-resolution NAIP image.varimage=ee.Image('USDA/NAIP/DOQQ/m_4307663_se_18_1_20130619');//Zoom map to Oakwood Cemetary at level 16 and display input image.Map.setCenter(-76.13,43.03,16);//The catch with entropy is that it needs discrete values, hence the image is rescaled.Map.addLayer(image,{max:255},'Inputimage');//Select NIR band from input image.varnir=image.select('N');//Define size and shape of neighborhood for deriving the texture information. varsquare=ee.Kernel.square({radius:3});//Compute entropy (texture) using the defined neighborhood information. varentropy=nir.entropy(square);//Display computed image texture outcome.Map.addLayer(entropy,{min:1,max:5,palette:['0000CC','CC0000']},'entropy');