Hot answers tagged

3

Here's a quick attempt using morphological image analysis on my own contour plot, since you did not provide yours: Generate a contour plot with some closed contours and style it more or less like yours: contour = ContourPlot[ Sin[2 x]^2 - Cos[2 y]^2, {x, y} ∈ Polygon[CirclePoints[{1, 90 Degree}, 6]], PlotPoints -> 75, Contours -> 4, ...


2

Here is one approach (Mathematica version 10 is required). Paste the following code as the next cell after the cell with your image and evaluate: cell = NotebookRead[PreviousCell[]]; m = CurrentValue[Magnification] Cases[cell, GraphicsBox[__, OrderlessPatternSequence[ImageSize -> {w_, _}, ___, ImageSizeRaw -> {w0_, h0_}], ___] :> {m {w, ...


2

If you want to get the Graphics representation of TreeForm, you'll need to convert it to boxes first, and then convert these boxes into a Graphics expression. The reason is that TreeForm is a special display form, and is converted directly into boxes for display without actually being evaluated into Graphics by the kernel. g = TreeForm[{1, 2, 3}] // ...


2

Just to save the solution for posterity: As nikie suggested in comments, you are looking for "IntensityCentroid" rather than the simple "Centroid" property to use in ComponentMeasurements. You can find it in the "Details" section of the documentation of the latter function, under "Spatial intensity measurements". In the help description ...


1

Here is another solution in the spirit of the answer by M.R. (should work starting from Mathematica version 7): AbsoluteImageDimensions[img_Image] := Module[{m = CurrentValue[Magnification], w0, h0, w}, {w0, h0} = ImageDimensions[img]; w = Options[img, ImageSize][[1, 2, 1]]; {m {w, w*h0/w0}, 100 (m w/w0)^2}] And here is a better version ...


1

Your image is not still good enough to work on. So I made one and show how to do it. Let say this is your picture XX = (# + RandomReal[{-.1, .1}]) & /@ Range[19]; XX = Join[{0}, XX, {20}]; YY = (# + RandomReal[{-.1, .1}]) & /@ Range[19]; YY = Join[{0}, YY, {20}]; img = ContourPlot[Evaluate[Join[(y == #) & /@ XX, (x == #) & /@ YY]], {x, ...


1

Using Alexey's pattern: AbsoluteImageDimensions[img_] := Module[{m = CurrentValue[Magnification]}, Cases[{ToBoxes@img}, GraphicsBox[___, OrderlessPatternSequence[ Verbatim[Rule][ImageSizeRaw, {w0_, h0_}], Verbatim[Rule][PlotRange, _], Verbatim[Rule][ImageSize, {w_, _}]]] :> {m {w, w*h0/w0}, 100 (m w/w0)^2}, ...


1

Mathematica also has a builtin function called ImagePeriodogram that returns an Image representing the power spectrum of the image. This won't help with phase spectra or reconstructing images, however.



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