shrx
• Member for 8 years, 9 months
• Last seen this week
• Slovenia

Alright, instead of separating the picture by graylevels, I tried to get more involved with component detections. I noticed the original painting has a different color for hair, face, mouth, eyes, and ...

A function to subdivide the triangles based on their gray level: h[{v1_, v2_, v3_}] := With[{a = EuclideanDistance[v1, v2], b = EuclideanDistance[v1, v3], c = EuclideanDistance[v2, v3]}, With[...

Here's my attempt at recreating the LinearLCM palette. It turned out to be very tricky, because it's not a linear problem. In addition the blog article and the paper cited are confusing the terms "...

Taken from the Matlab code here http://www.math.utah.edu/~eyre/computing/matlab-intro/ch.txt with slight modifications: m = n = 256; delx = 1/(m - 1); delx2 = delx^2; x = Range[0, 1, delx]; delt = 0....

I was stuck for a while with a not really acceptable result, but then @belisarius posted his answer and I was able to refine my code with the usage of his findCurvedPath2 function. So I am able to ...

This is a fast and quite good way to create the mask of the spider: i = Import["http://i.stack.imgur.com/2Lz0A.jpg"]; mask = Dilation[ DeleteSmallComponents@ ColorNegate@ DeleteSmallComponents@ ...

First you determine the binormal distribution of the data: data = RandomVariate[BinormalDistribution[{1, 0}, {2.5, 5}, 0], 10^4]; dataX = data[[All, 1]]; dataY = data[[All, 2]]; dist = ...

Function to generate n equally-spaced colors: discreteColors[n_] := With[{partL = Ceiling[Sqrt[n]]}, DeleteCases[ Flatten[Transpose[ Partition[ Table[Lighter[Darker[Hue[c], .1], ....

First, we define a suitable color function that cycles from green to purple: cf[h_] := If[h < .5, h + .4, (1 - h) + .4] SetAttributes[cf, Listable] And then we apply it to the hue channel of our ...

This is not a direct answer to your problem, but rather a generalization of @Jens' code from double to n-tuple pendulums. Meaning you can also use it for double pendulums if you like. I'm providing it ...

rgb = ColorConvert[#, "CMYK" -> "RGB"] & /@ CMYKColor @@@ cmyk ImageAssemble[{Graphics[#, ImageSize -> 20] & /@ Partition[Riffle[rgb, Rectangle[], {2, -1, 2}], 2]}] Edit: to get raw ...

You can use ImageResize to resample the z-direction for your purpose. imgs = Import /@ { "http://i.stack.imgur.com/CXvgm.jpg", "http://i.stack.imgur.com/RJJnL.jpg", "http://i.stack....

I see the "Van Gogh" style as a combination of brush strokes and an averaging filter. This is the best result of my effort to simulate this style. I'm sure someone with better knowledge can improve it....

u[x_, y_] := Sin[x] + Cos[y] v[x_, y_] := E^-x + y w[x_, y_] := Tanh[x] + Sqrt[y] RegionPlot[2 x^2 + y^2 < 1, {x, -1, 1}, {y, -1, 1}, Mesh -> None, ColorFunction -> Function[{x, y}, RGBColor[...

n = 10; GridGraph[{n + 2, 2}, EdgeStyle -> {1 <-> n + 3 -> Opacity[0], n + 2 <-> 2 n + 4 -> Opacity[0]}, BaseStyle -> Black, VertexShape -> {1 -> Null, n + 2 ->...

i = ExampleData[{"TestImage", "Mandrill"}]; id = ImageDimensions[i]; Create some keypoints and use them to make a triangular mesh: xy = ImageKeypoints[i, MaxFeatures -> 50]; m = VoronoiMesh[xy, {...

Using @b.gatessucks' hint, I solved it with the following transformation: max = Max[data]; Show[ ListPlot[{Sqrt[max #[[2]]] Sin[Sqrt[max #[[1]]]], Sqrt[max #[[2]]] Cos[Sqrt[max #[[1]]]...

Another option would be to use the at command to create detached jobs: echo "math -script test.txt" | at now

Here is a minimal example on how to run a mathematica script on a raspberry pi. Create a simple script (I used my bash terminal to do it): echo "sum=1+1; Print[sum]" > test.wl Excecute the script:...

You can achieve the desired transformation with the ImageForwardTransformation function. The transformation effect is easily visible on a grid image: grid = Rasterize[ Graphics[Rectangle[], ...

A quick example how to generate the first two frames. Just the basic layout, no fancy annotations, but you should get the idea. First, define the functions that draw the frames: frame1[{int1_, int2_}...

I had to modify the /usr/local/bin/mathematica script to fix 3D antialiasing. It seems that the GLTest script fails and as a consequence Mathematica disables advanced 3D rendering. The fix is to ...

Your provided data is very noisy. You can get more information from it if you filter it first. I will apply a LowpassFilter and a logarithmic transform on the $y$ values, and scale down the $x$ values....

Take a look at Inset: Plot[Exp[-x], {x, 0, 10}, PlotRange -> All, Epilog -> Inset[Plot[Sin[x], {x, 0, 2 π}], Scaled[{.7, .5}]]]

Here is my solution using RevolutionPlot3D to draw the disk layers, it's faster; First convert the image to data rows: imgd = Map[First[#] &, ImageData[ColorConvert[img, "Grayscale"]], {2}]; ...

Cusp detection using information from this post, and following the code from @belisarius' answer: Transformation of the image to polar coordinates: maxRadius = r + 10; polar = ImageTransformation[i1,...

If you have OpenBabel installed, you can use its built-in structure optimization methods to generate 3D structures from SMILES structure format provided by Mathematica: Import["!obabel -:\"" <> ...

First, convert your data arrays to images with Image[]. If your imageR and imageG have good brightness, and imageB is too dark: meanIntensity = Mean[ImageMeasurements[#, "MeanIntensity"]& /@ {...