3

I have tested three methods to segment my image collection:

(https://code.earthengine.google.com/699f04706c114260068275acd2605644)

var l8sr = ee.ImageCollection('LANDSAT/LC08/C01/T1_SR');

function maskL8sr(image) {
// Bits 3 and 5 are cloud shadow and cloud, respectively.
var cloudShadowBitMask = ee.Number(2).pow(3).int();
var cloudsBitMask = ee.Number(2).pow(5).int();
// Get the pixel QA band.
var qa = image.select('pixel_qa');

// Both flags should be set to zero, indicating clear conditions.
var mask = qa.bitwiseAnd(cloudShadowBitMask).eq(0)
  .and(qa.bitwiseAnd(cloudsBitMask).eq(0));

// Return the masked image, scaled to [0, 1].
return image.updateMask(mask);
}

// Map the function over one year of data and take the median.
var composite = l8sr//.select(bands)
           .filterDate('2017-05-01', '2017-10-1')
           .filterBounds(StJohn)
           .sort('CLOUD_COVER')
           //.limit(500)
            .map(maskL8sr)
            //.median()
            .mosaic()
            ;

 // This method belongs to this 
 link:https://gis.stackexchange.com/questions/273658/object-based-image- 
 classification-in-google-earth-engine
 var boxcar = ee.Kernel.square({
 radius: 7, units: 'pixels', normalize: false });

 var smooth = composite.convolve(boxcar);
 Map.addLayer(smooth, {bands: ['B4', 'B3', 'B2'], max: 0.5}, 'smoothed');
 // These are the GEE methods for Object-based
 var objim= composite.connectedPixelCount();
 Map.addLayer(objim,{},'obj');

 var patchid = composite.connectedComponents(ee.Kernel.gaussian(1), 256);
 Map.addLayer(patchid, {bands: ['B4', 'B3', 'B2'], min: 0, max: 0.3}, 'patches');

Unfortunately, the results visualization are not appropriate for me. Also, I need to classify this image collection using my own training data, so I don't want to use clustering or unsupervised methods. I was wondering if anybody could help me to solve it.

closed as unclear what you're asking by whyzar, MaryBeth, nmtoken, Dan C, xunilk Jun 6 '18 at 21:17

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • What is your question? Provide a clear explanations of what your desired output is and what was wrong when you did classification described. – Ruslan Jun 6 '18 at 17:38
  • Thank you for your response. The output should like an classified image (the boundaries should be clear), but these results only classifies water. Also, the accuracy of object-based classification is not as well as pixel-based. In fact Validation overall accuracy: for object-based is 20% weaker than pixel-based using my test data. – Mohammad Mazloumi Jun 6 '18 at 17:50
  • So what is a specific problem that you want help with? People here can help you if you can provide a specific description of issue with your classification method, but they will not do a classification for you. Water being the only good/accurate class is not a specific issue - it is present in almost any classification. – Ruslan Jun 6 '18 at 17:58
  • I want to do a object-based classification. At first, it is crucial to segment the image, as I know, these results are not segmented. Also, I did not say "please classify this image guys!!". – Mohammad Mazloumi Jun 6 '18 at 18:08
  • Then change the question title and content to reflect that. You need help with image segmentation: show what your output looks like and what you expect to see instead. I'm not being rude, nor do I think you are, just be specific. – Ruslan Jun 6 '18 at 18:15