I am trying to remove cloud and composite all Landsat 5 TOA images available in a given year and region into a composite of final image. However, I noted that the quality of final composite image is not consistent and seamless over the large area after cloud masking and median composite.
I have also tried with Landsat 5 surface reflectance, but it is not much improved and the edge of each overlapping image is not consistent and seamless.
Here is my code https://code.earthengine.google.com/b58c843a3c1118495f53a88498089fdd:
/// Data Preprocessing: Landsat 2000
var LS2000=LS5.filterBounds(VN).filterDate("2000-01-01","2000-12-31")
.filterMetadata("CLOUD_COVER","less_than",70)// Filter the study area, cloud and date range
// Dissplay the raw image
Map.centerObject(VN,9) // Zoom in the given study area
Map.addLayer(LS2000.median().clip(VN),{bands:["B3","B2","B1"],min:0.06,max:0.3},"Landsat 2000",false)
/// Cloud Masking
var threshold=50 // Set threshold for cloud masking
var cloudmask=function(image){
var cloudscore=ee.Algorithms.Landsat.simpleCloudScore(image)
var cloudlikelihood=cloudscore.select("cloud").lt(threshold)
return image.updateMask(cloudlikelihood)
} // Function to isolate cloud pixels each image
var LS2000_CloudMask=LS2000.map(cloudmask).median().clip(VN)
// Display Landsat cloud masked
Map.addLayer(LS2000_CloudMask,{bands:["B3","B2","B1"],max:0.20,min:0.09},"Landsat 5 Cloud Masked")
// 'Samples' geometry region is just example showing the inconsistency
// and unsmoothness of the image after cloud masking and median composite.
What technique could I improve the quality of consistency and seamlessness of composite image?