Initilization
Initilization
i=ImageResize
,500;
colorFunction="SunsetColors";
01
01
Relief plot of distance transfrom:
ReliefImage[DistanceTransform@ColorNegate@i,ColorFunctioncolorFunction]
02
02
Basic 3D representation of distance transform:
ListPlot3D[Downsample[ImageData@DistanceTransform@ColorNegate@i,3],PlotRangeAll,BoxRatios{1,1,0.1},ColorFunctioncolorFunction,MeshNone,ImageSize700,ViewPoint{0.8449204967019579,-1.8336138685000487,2.215505392279161}]
Animated version:
graphics=With[{images=Table[ImageResize[RandomImage[1,{10,10}],500,Resampling"CatmullRom"],{4}]},Table[Rasterize@ListPlot3D[Rescale@Abs@Downsample[ImageData@ImageMultiply[DistanceTransform@ColorNegate@i,Blend[images,b]],3],PlotRangeAll,BoxRatios{1,1,0.1},ColorFunctioncolorFunction,MeshNone,ImageSize700,ViewPoint{0.8449204967019579,-1.8336138685000487,2.215505392279161}],{b,0,1,1/60}]];
ListAnimate[graphics]
Theoretical code for animated version which is too slow. We can make this look like the source to be a bit cleaner:
◼
( With[{images = Table[ImageResize[RandomImage[1, {10, 10}], 500, Resampling -> "CatmullRom"], {4}]}, Manipulate[ListPlot3D[Rescale@Abs@Downsample[ImageData@ImageMultiply[DistanceTransform@ColorNegate@i, Blend[images, b]], 3], PlotRange -> All, BoxRatios -> {1, 1, 0.1}, ColorFunction -> colorFunction, Mesh -> None, ImageSize -> 700, ViewPoint -> {0.8449204967019579, -1.8336138685000487, 2.215505392279161}], {b, 0, 1}]] *)
◼
03
03
3D representation of distance transform multiplied by random noise:
ListPlot3D[Map[RandomReal[]*#&,Downsample[ImageData@DistanceTransform@ColorNegate@i,3],{2}],PlotRangeAll,BoxRatios{1,1,0.1},ColorFunctioncolorFunction,MeshNone,ImageSize700]
Animated version:
graphics2=With[{images=Table[ImageResize[RandomImage[1,{10,10}],500,Resampling"CatmullRom"],{15}]},Table[Rasterize@ListPlot3D[Rescale@Map[RandomReal[]*#&,Abs@Downsample[ImageData@ImageMultiply[DistanceTransform@ColorNegate@i,Blend[images,b]],3],{2}],PlotRangeAll,BoxRatios{1,1,0.1},ColorFunctioncolorFunction,MeshNone,ImageSize700],{b,0,1,1/60}]];
ListAnimate[graphics2]
Theoretical version (very slow):
With{images=Table[ImageResize[RandomImage[1,{10,10}],500,Resampling"CatmullRom"],{15}]},ManipulateListPlot3D[Rescale@Map[RandomReal[]*#&,Abs@Downsample[ImageData@ImageMultiply[DistanceTransform@ColorNegate@i,Blend[images,b]],3],{2}],PlotRangeAll,BoxRatios{1,1,0.1},ColorFunctioncolorFunction,MeshNone,ImageSize700],{b,0,1},Initializationi=ImageResize
,500;colorFunction="SunsetColors";