New answers tagged

0

Don't very sure what you want,this is my thinking about your question m = DeleteSmallComponents[ LaplacianGaussianFilter[tD, 1.4] // Binarize, 60] SelectComponents[ Colorize[MorphologicalComponents[m, Method -> "ConvexHull"], ColorRules -> {0 -> Black, _ -> White}], Small] If you get the unfilled border,you can use ...


9

Using GaussianFilter on the raw RGB data will produce a convolution in all 3 dimensions of the list (rather than just the 2 spatial dimensions of the image). So filtering the raw data will also convolve RGB values at the same pixel. To see this effect, we can start with a uniform red image where all RGB values are {1,0,0}: test2 = Table[{1, 0, 0}, {m, 20}, ...


2

One approach is to locate the black components and then measure some properties of them. Here we locate them using MorphologicalComponents, find the centroids using ComponentMeasurements and then calculate the distance between the centroids using Nearest. img = Import["http://i.stack.imgur.com/hALsH.jpg"]; imgBW = Binarize@ColorConvert[img, "Grayscale"]; ...


2

This is not an answer more of an extended comment... My mission is to extract information on the typical distance between the black patches in the image I have attached here. Do we have to use Fourier transform for this? For example we can get the required estimate with these commands: img = Import["http://i.stack.imgur.com/hALsH.jpg"]; Row[{"Image ...


2

It looks like random blobs, and that's what the FFT suggests... img = Import["http://i.stack.imgur.com/hALsH.jpg"]; imgBW = ImageData@ColorConvert[img, "Grayscale"]; imgZ = imgBW - Mean@Mean[imgBW]; xf = Abs[Fourier[imgZ, FourierParameters -> {1, -1}]]; {d1, d2} = Ceiling[Dimensions[xf]/2]; xCentered = RotateLeft[xf, {d1, d2}]; ArrayPlot[xCentered] ...


3

One possibility is to use Dilation with a tall vertical structuring element. For example: mask = Import["http://i.stack.imgur.com/L60Yd.png"] Dilation[Erosion[mask, 2], ConstantArray[1, {160, 1}]]


7

You can use Interpolate to interpolate between the polygon vertices: First make sure the polygon is closed, by appending the first vertex: cyclic = Append[manualPolyPoints, First[manualPolyPoints]]; then accumulate the distance from one vertex to the next: accumulatedDistance = Rescale@Prepend[Accumulate[Norm /@ Differences[cyclic]], 0.]; then ...


5

This answer compares two dimension reduction techniques SVD and Non-Negative Matrix Factorization (NNMF) over a set of images with two different classes of signals (two digits below) produced by different generators and overlaid with different types of noise. Note that question states that the images have one class of signals: I have a stack of images ...


10

As requested by Anton. I halved the amount of noise because otherwise some images have barely any signal left. As you can see below, we are still putting in a significant amount of noise. (To conserve space I'm only visualizing the first ten images in this answer, but the denoising is happening over all 100 test images.) SeedRandom[2016] (* for ...


15

Start data First let us get some images. I am going to use the MNIST dataset for clarity. (And because I experimented with similar data some time ago.) MNISTdigits = ExampleData[{"MachineLearning", "MNIST"}, "TestData"]; testImages = RandomSample[Cases[MNISTdigits, (im_ -> 0) :> im], 100] Let us convince ourselves that all images have the same ...


13

Here is an approach that requires no manual interaction: g = Import["http://i.stack.imgur.com/pT8aP.jpg"]; shape = Position[ImageData[Binarize[g]], 1, {2}]; pc = PrincipalComponents[N@shape]; lm1 = Internal`ListMin[pc][[All, 2]]; lm2 = -Internal`ListMin[-pc][[All, 2]]; slitWidth = Mean[lm2] - Mean[lm1] (* ==> 83.6331 *) Here, I'm using the ...


20

Extract lines at the edge of the object: lines = ImageLines[EdgeDetect[FillingTransform[Binarize[img]]]]; HighlightImage[img, {Thick, Yellow, Line /@ lines}] From here you can rotate the image if you get the angle: θ = Mean[ArcTan @@@ Subtract @@@ lines] (* 1.67222 *) ImageTransformation[img, RotationTransform[\[Theta] - Pi/2], Padding -> 0, ...


2

"Fisheye projection" can mean multiple different things. The most common projection used by lenses is the equal-area one, for which you were using a formula: $$ r = 2f\sin(\theta/2) $$ Here $\theta$ is the angle under which a point is visible and $r$ is the distance of that point's projection from the optical axis on the image plane. Please see the link ...


2

This turned out to be pretty simple, using ClickPane to capture the clicks, and MousePosition so that you can see the current coordinates. After running the code below, and placing your mouse over the plot, the coordinates are displayed above the plot. After clicking, the coordinates you click are added to the list pts. This bypasses any interaction with ...


1

You might try to use Locatorfor this purpose. Try this: coord = {}; DynamicModule[{pt = ImageDimensions[im]/2 // N}, Column[{ Show[{ image, Graphics[Locator[Dynamic[pt]]] }], Dynamic[pt], Button["Get coordinates", Clear[coord]; coord = pt] }] ] where ´image` is the name of your image and coord is the global variable. You ...


18

This was a fun question to answer, even considering that I know nothing about general relativity. It's all a matter of translating the equations presented in this paper by Oliver James, Eugenie von Tunzelmann, Paul Franklin, and Kip Thorne into notebook expressions. Embedding Diagrams The paper gives some really cool figures to show the curvature of ...


6

Here is something I tried based on Simon's answer to How to create a new “person curve”? I am starting from a text. pic = Rasterize[Style["Captcha", FontFamily -> "Sans"], ImageSize -> 300] // Image Now introducing Simon functions param[x_, m_, t_] := Module[{f, n = Length[x], nf}, f = Chop[Fourier[x]][[;; Ceiling[Length[x]/2]]]; nf = ...



Top 50 recent answers are included