mapbox / nodata

Because the pixels you can't see are harder than the ones you can.
MIT License
1 stars 3 forks source link

Visual inspection of results, slic vs simple #23

Closed perrygeo closed 8 years ago

perrygeo commented 8 years ago

Screenshots to illustrate.

Red = Simple Mask (ie exactly equal to nodata) Purple = Additional Pixels Masked by slic approach

perrygeo commented 8 years ago

lossy_curved_edges.tif :+1:

screen shot 2015-09-30 at 10 22 20 am

In slightly more detail, the original image (with some edge artifacts that are likely nodata)

the simple mask

the slic mask

perrygeo commented 8 years ago

lossy_irregular_edges.tif :+1:

screen shot 2015-09-30 at 10 22 51 am
perrygeo commented 8 years ago

losey_noisey_nodata.tif :-1:

screen shot 2015-09-30 at 10 24 57 am

And setting slic n_clusters to 100, still :-1:

screen shot 2015-09-30 at 10 25 31 am
perrygeo commented 8 years ago

For the similar-edges images, slic solves both the lossy collars

screen shot 2015-09-30 at 11 01 08 am

And the simple mask's tendency to assign nodata to interior pixels

screen shot 2015-09-30 at 10 59 20 am

:+1: :+1:

perrygeo commented 8 years ago

So the scorecard is 4/5 for slic, 0/5 for simple

I should note performance... numbers look roughly like

slic_mask(...) 3.9418361187
simple_mask(...) 0.0145719051361

So for imagery that's known to have non-lossy edges, simple makes a huge difference in speed. Still some opportunities to speed up slic approach too I'm sure.

dnomadb commented 8 years ago

Awesome @perrygeo ! So happy that the slic approach is working.

So for imagery that's known to have non-lossy edges, simple makes a huge difference in speed

Yes, so right now we'll assume that the command will be invoked w/ a lossy flag that will only run if the imagery is lossy. This brings up an important point: we'll want to add test fixtures / tests for non lossy imagery as well. I'll ticket and take this on.

Another side note that we discussed: we are going to implement a function that will check if the buffered window contains any nodata, and simply return a fully valid mask band - this will speed it up as a whole.