New answers tagged

2

Method1: meshes = ConnectedMeshComponents@ ImageMesh@ CurvatureFlowFilter[FillingTransform@Dilation[img, 1], 10]; Graphics[ BSplineCurve[MeshPrimitives[#, 0][[All, 1]], SplineClosed -> True] & /@ meshes]


2

img = Import["https://i.stack.imgur.com/qeQfj.jpg/qeQfj.jpg"]; ImageApply[If[#[[2]] >= Max[#], #, {0, 0, 0}] &, img] Alternatively, remove red and blue channels if green channel value is the maximum of the three channel values: ImageApply[If[#[[2]] >= Max[#], #[[2]] {0, 1, 0}, {0, 0, 0}] &, img]


1

Not the transformation you are looking for but Mathematica has a ColorsNear function: img = Import["https://i.stack.imgur.com/qeQfj.jpg/qeQfj.jpg"] ColorDetect[img, ColorsNear[Darker@Green]]


3

There are other questions about reconstruction such as this one and this one. I wanted to specifically address automatically finding the block size. This is kind of hard in general as the shuffled image may not necessarily contain hard edges. Below is my crude attempt: (* get the image *) img = Import["https://i.stack.imgur.com/fJb9a.png"]; (** ...


4

Are you looking for a smaller number of coordinates on the boundary of the image? If so, you could convert to a boundary mesh region and extract the coordinates from that. After importing the image: mesh = ImageMesh[ColorNegate[img]]; points = MeshCoordinates[mesh]; This gives a list of points on the boundaries of the parts of the image. E.g., to plot those ...


2

If you need coordinates for the pixels that are black, you can import the image. The information is actually stored in the alpha channel of the image, so we use only that: img = Binarize@AlphaChannel@Import["https://i.stack.imgur.com/dYO3S.png"] Then you can use Position on the image data matrix to get all 1 pixel. I did some transposing and ...


2

You can Rasterize Grid[plots] and use it with Inset as Prolog in Graphics: Graphics[MapThread[{AbsoluteThickness[3], #, Arrowheads[Large], Arrow[#2]} &, {{Red, Green, Blue}, {{{0, 0}, {1, 1}}, {{0, 1/2}, {1, 1/2}}, {{1/2, 0}, {1/2, 1}}}}], Prolog -> Inset[Rasterize[Grid[plots, Frame -> All]], Automatic, Automatic, 1], ImageSize -> ...


1

You could use "Overlay" but the result is more a "hack" and not really satisfying: dx = 1; dy = 1; axes = Graphics[{Thickness[0.01], Red, Arrow[{{-dx, 0}, {dx, 0}}], Arrow[{{0, -dy}, {0, dy}}], Green, Arrow[{{-dx, -0.95 dy}, {dx, 0.95 dy}}], Text[Style["X", Red, Large], {0.95 dx, 0.05}], Text[Style["Y&...


Top 50 recent answers are included