Tag Info

New answers tagged

1

Here is an other image processing alternative. The main idea is as a pre-processing step using Gradient Filter. (I think most of them may work in 3D as well.) img = Import["http://i.stack.imgur.com/g7TFl.png"]; imgG = ColorConvert[img, "Grayscale"]; imgA= ColorNegate@GradientFilter[imgG, 3] // ImageAdjust imgB= ImageMultiply[MeanShiftFilter[imgG, 2, 0.3, ...


0

A third attempt would be to try the WatershedComponent Approach presented by bill s above, as in u = GaussianRandomField[128, 3, Function[k, k^-1]] // Chop //GaussianFilter[#, 15] &; so that the watershed is applied on each slice: WS = Map[WatershedComponents[Image[#], Method -> {"MinimumSaliency", .3}] &, u, 1]; Colorize[#] & /@ ...


5

We can transform the image into polar coordinates, after which averaging across angles is trivial. polarTransform[img_, rmax_] := With[{size = Max@ImageDimensions[img]}, ImageTransformation[img, Function[{r, t}, {r Cos[t], r Sin[t]}] @@ # &, {rmax, 2 Pi rmax}, DataRange -> {{-size/2, size/2}, {-size/2, size/2}}, PlotRange -> {{0, ...


4

How about using nesting ImageRotate: t = NestList[ImageRotate[#, 5 Degree, Full] &, img, 71]; ImageData /@ t; out = Total[%] // Image // ImageAdjust Extracting a line looks similar to yours idata = ImageData[out]; ListPlot[idata[[All, 512]], PlotRange -> {{512, 652}, {0.4, 1}}, Frame -> True]


5

Another possible path is to extend Vitaliy's function FindCrossings2D to 3D In its current form, it is inefficient and somewhat buggy. Identify all 3D extrema Start with a Gaussian random field u = GaussianRandomField[16, 3, Function[k, k^-1]] // Chop // GaussianFilter[#, 6] &; Build its gradient fu = u // ListInterpolation[#, Method -> ...


4

Let me start and answer my own question (with what I have so far) since it might trigger some interest before the bounty expires. The motivation is to find rapidly 3D maxima of the field. Posible idea The idea is to define 3D maxima, as the intersection of the union of 2D maxima (using 'MaxDetect') sliced in two different directions. Starting with a ...


0

The code you posted did not produce errors for me, try running on a fresh kernel. To plot the solution: Plot[v[t] /. First[a], {t, 0, 100}]


1

With h = {5, 4, 2, 8, 9, 1} and indices {1,3,5,6} h[[{1, 3, 5, 6}]] is {5,2,9,1} and Max[h[[{1, 3, 5, 6}]]] is 9, so Position[h,9] is {{5}} en we get rid of the double brackets by `Position[h,9][[1]]` all-in-one becomes Position[h, Max[h[[{1, 3, 5, 6}]]]][[1, 1]]


6

Update: This seems to be a problem restricted to 32 bits Windows systems Just copying your first line random = {RandomReal[{-1, 1}, {500, 5}], RandomReal[{-1, 1}, 500]}; and then a slight change: mods = Tally@Table[LinearModelFit[random], {1000}] I tally the resulting FittedModels. I sometimes get only a single model (counted 1000 times) and ...


0

Try NMaximize. Maximize[{2^(-1-n)(1+k)^(-1-n)(1+2k)^(-1+n)(-1 - 2 k + n)(-2 k + n),k<=n/2, k>=1},{n,k}]


1

Seems like the problem is not solved completely in the previous post. For this problem, it is straightforward to obtain the positive semi-definite condition of S by Cholesky decomposition, which all the diagonal elements should be nonnegative. Diagonal[CholeskyDecomposition[S]] After some simplification, it can be shown the diagonal elements are {1/r, ...


6

To demonstrate the time saving using a linked list instead of AppendTo :- time1[myN_] := First@Timing[ finalList = {}; For[i = 1, i <= myN - 3, i++, For[j = i + 1, j <= myN - 2, j++, For[k = j + 1, k <= myN - 1, k++, l = RandomInteger[{k + 1, myN}]; AppendTo[finalList, {i, j, k, l}]]]]]; time2[myN_] := First@Timing[ ...


8

To create Experimental`NumericalFunction, one needs to evaluate Experimental`CreateNumericalFunction[vars, expr, dims] where vars is a list of arguments, expr - the expression from which the numerical function will be created, dims - the dimensions of the output matrix produced by this expression. If the output is scalar, then dims should be set to {}. It ...


0

Forget about using Solve for Economics problems. Use Reduce instead or FindInstance if you want exact answers (but works only with small systems, see below) http://www.mathematica-journal.com/2014/03/using-reduce-to-compute-nash-equilibria/ The above article in the Mathematica Journal has an example from consumer theory (2 goods ). To solve larger demand ...


0

General::eit is simply the format string for the message itself. There is MessageList[n] which gives the names of all messages output during the evaluation of input line n but that doesn't get you any further. Defining a value for $MessagePrePrint would be the way to do this, see the second Scope example using Block, Reap and Sow in the documentation, but ...


1

For example: experimArray = Range@20; theoretArray = ListConvolve[{a, b, c, d, e}, Range@24] sol = NMinimize[Norm[experimArray - theoretArray], {a, b, c, d, e}] So: theoretArray /. sol[[2]] (* {1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., 16., 17., 18., 19., 20.} *)



Top 50 recent answers are included