Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I'm using the Orfeo Toolbox for segementation of large Very High Resolution Satellite images. It performs very well and i'm mostly very happy with it. But I still get some weird/bad results that I assume are related to the partition of the process in tiles.

I'm doing this:

#Segmentation variables spatialr = '7' maxiter = '6000' ranger = '2,6' minsize = '8000' tilesize = '1048' simplify = '0.4' # SEGMENTATION
print "Performing image segmentation" app = otbApplication.Registry.CreateApplication("Segmentation") app.SetParameterString("in", imagem_base_com_ndvi) app.SetParameterString("filter.meanshift.spatialr", spatialr) app.SetParameterString("filter.meanshift.maxiter", maxiter) app.SetParameterString("filter.meanshift.ranger", ranger) app.SetParameterString("filter.meanshift.minsize", minsize) app.SetParameterString("mode.vector.inmask", image_mask) app.SetParameterString("mode.vector.stitch", 'True') app.SetParameterString("mode.vector.out", vector_out) app.SetParameterString("mode.vector.simplify", simplify) app.SetParameterString("mode.vector.outmode", 'ovw') app.SetParameterString("mode.vector.tilesize", tilesize) app.SetParameterString("mode.vector.neighbor", 'True') app.ExecuteAndWriteOutput()

Here are some examples of the resulting segmentation:

enter image description here

enter image description here

Anyone has ideas to help me avoid these errors?

Thanks.

share|improve this question
    
Could you make these two (sub)maps available as GeoTIFFs to play around? –  markusN May 3 '13 at 13:45
    
Here's a portion of an image mosaic, not the same as those, but similar. dl.dropboxusercontent.com/u/18901524/test.zip –  vascobnunes May 3 '13 at 14:09
    
@vascobnunes, I noticed GDAL is an external dependency of OTB. Would it be possible to run your segmentation against a .vrt mosaic of the tiles? –  elrobis May 3 '13 at 15:14
1  
yes, I thinks it's possible, but why? –  vascobnunes May 3 '13 at 15:39

2 Answers 2

up vote 6 down vote accepted

To better understand, I have done a similar segmentation in GRASS GIS 7 using the new i.segment. In my opinion these lines appear where the image data were mosaiked due to a non-perfect histogram matching (or whatever) being used.

In short: Orfeo or any other segmentation software may deliver better results when the initial mosaiking is improved to avoid the borders being visible. This may require a seamline mosaiking approach.

Proof: Using your data as provided in your comment, I performed the following steps (reported here for reproducibility):

Creating a GRASS GIS location from the dataset:

gdalinfo test.tif
# -> it is UTM36S
grass70 -c test.tif utm36s

Then data registration (rather than true import) of the GeoTIFF:

r.external test.tif out=image_to_be_segmented

Setting the computational region to the map:

g.region rast=image_to_be_segmented.1 -p

Then image segmentation (note, that I used simply the default settings!) and vectorization:

i.segment image_to_be_segmented out=segmented_image threshold=0.5
r.to.vect segmented_image out=segmented_image type=area

Eventually visualize the results:

d.mon wx0
d.rgb b=image_to_be_segmented.1 g=image_to_be_segmented.2 r=image_to_be_segmented.3
d.vect segmented_image type=boundary -c

Full sample map (as you see I did not clean up small area with v.clean:

enter image description here

Zoomed result (here the mosaiking problem is well seen which results in straight, undesired lines, you need to look at the full extent uploaded image):

enter image description here

For a final result, small areas should be removed etc but in the first place proper input data are needed.

share|improve this answer
    
wow! you got into a lot of work... thanks! I didn't know of i.segmentation. The mosaiking problem was one I was expecting and ready to manually deal with. but the thing with the orfeo toolbox segmentation is with the tiles in which the image is divided by the algorithm for large image processing: blog.orfeo-toolbox.org/preview/… –  vascobnunes May 6 '13 at 10:35
    
I see... so while waiting you may try i.segment out. Large file support is the standard in GRASS 7. –  markusN May 6 '13 at 14:05
    
I tryed your process suggestion for a small area and the result was very satisfactory, but now i'm trying for the entire area I need (an image of 1.6gb) and grass has been running for 4 days now, and still nothing... :( –  vascobnunes May 13 '13 at 12:32
    
still processing, 5 days now and only about 30% of the total in Pass 1... –  vascobnunes May 14 '13 at 9:19
1  
Do you use a recent GRASS 7 version from SVN? How many pixels does the computational region have? (g.region -p) will tell you... –  markusN May 14 '13 at 18:58

note that next OTB release (3.20) will provide a new segmentation workflow based on the mean-shift algorithm which allows to perform tile-wise segmentation of very large image with theoretical guarantees of getting identical results to those without tiling.

You can find a description of the workflow (different from the one cited above) here.enter link description here

HTH

share|improve this answer
    
I'm currently using OTB 4.0 and still have the same problems... :/ –  vascobnunes May 22 at 12:55

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.