datashader icon indicating copy to clipboard operation
datashader copied to clipboard

Seam carving support

Open jbednar opened this issue 9 years ago • 0 comments

Seam carving example

Once we have an aggregate array for a particular dataset, it would be interesting to try seam carving or related techniques to nonlinearly warp the array to focus on the "interesting" regions in the data. For instance, many geographic plots are hard to use because of the highly nonlinear geographic distribution of the population; seam carving may help equalize the on-screen area devoted to different geographic regions (though there are also techniques for doing that more directly based on population density). Or just in general, one might want to look at a very large, highly nonlinear distribution and discover the interesting bits, which would be easier if only the interesting bits (according to some energy or entropy-based definition of "interesting") are shown.

The approach is somewhat analogous to the histogram equalization already provided for the z dimension (i.e., perpendicular to the screen x,y coordinates), but now used for the dimensions that are mapped spatially, with extra constraints because of the 2D shape that make histogram equalization not directly applicable (as well as using entropy/energy/gradient instead of counts, as in histogram equalization).

For 1D curves like timeseries, could perhaps do something more directly comparable to histogram equalization: normalize the amount of screen space devoted to each stretch of the timeseries according to the energy required, nonlinearly warping time so that the resulting signal appears to have roughly uniform variation over time. At that point, this specific nonlinear warping could be applied to a different timeseries of interest (or many of them), and the shape of such a plot would indicate whether the other timeseries covary in interestingness (entropy, etc.) with the first one. If they don't, there will be long stretches of little activity in these other timeseries plots warped in this way, indicating that when interesting things were happening in the first one, little was happening in the others. In this way one could directly compare and look for covariation in interestingness of the timeseries (however defined), rather than simply covariation in the signals themselves. I would assume that financial applications would yield appropriate examples for such analysis.

Whether in 1D or 2D, we'd need some way to package up the nonlinear mapping used as a record of what was done, so that an external viewer (e.g. bokeh) could show appropriate axis labels or hover information. I.e., once something interesting has been observed, it's important to be able to go back to the original coordinates of the data, which will be fairly complex to achieve. The cartopy package might help with visualizing these nonlinear projections, at least for geographic data.

I believe there has been some work with 2D seam carving in the related Abstract Rendering project, some of which could be applied here.

jbednar avatar Mar 10 '16 18:03 jbednar