Tag Info

Hot answers tagged

6

This one takes less than one third of the time in my machine. The main idea is NOT converting to ImageData[] to speed up image ops. imgs = Import /@ fNames; fun[img_, idx_] := ImageApply[UnitStep[# - .18]/number idx &, img]; imgs1 = MapIndexed[fun[#1, #2[[1]]] &, imgs]; fold = Fold[ ImageAdd[ImageSubtract[#1, ImageMultiply[#1, Binarize[#2, 0]]], ...


5

This seems quicker. Importing the images is the slowest bit, there's probably not much you can do about that. fNames = FileNames["*.png"]; n = Length @ fNames; bins = Table[ Clip[Import[fNames[[i]], "GrayLevels"], {0.18, 0.18}, {0, i/n}] , {i, n}]; Colorize[ Image[Map[Max, Transpose[bins, {3, 1, 2}], {2}]], ColorFunction -> "TemperatureMap"]


3

Consider also 'Sort' and 'First' > (your expression here...) // Sort // First Max also suffers poor performance on DateObjects that can remedied in similar form: > (your expression here...) //Sort // Last To comment on the OP situation: at this time (MMA 10.0.2) short lists also suffer unacceptable delays. For example, applying Min or Max to a ...


2

This seems to be somewhat faster. I use N[] or equivalent thereof in some places. Also removed a Floor since the argument had to be integral anyway. Clear[f, fr] f[n_, 0, s_, a_] := 1 fr[n_, s_] := fr[n, s] = Sum[m^-s, {m, 1., n}] f[n_, 1, s_, a_] := f[n, 1, s, a] = fr[n, s] - fr[a, s] f[n_, k_, s_, a_] := f[n, k, s, a] = N[Sum[Binomial[k, j] ...



Only top voted, non community-wiki answers of a minimum length are eligible