18

There are many ways to do this, modifying, improving my method or doing a completely different thing. My goal here is to show a very basic idea that should give you a start. LocatorPane and Manipulate give means of interactive addition/deletion and dragging of points in 2D plane. The problem is how to add an edge -- there has to be interaction between 2 ...


8

Here is an approach based on WatershedComponents and MorphologicalGraph. Some of the steps feel a bit over-complicated, so feel free to point out any improvements. The end result is a Graph expression describing the cell walls: Here is the code with some intermediate results: Get the original image: img = Import["https://i.stack.imgur.com/elbTN.png"] Do ...


7

Here's my take at the issue (some comments are inlined) extractRectangles[i_Image?ImageQ] := Block[ {dims, i0, i1, masks1, masks2, masks3, tfun, coords}, (* downsampling (just to make it faster) *) i0 = ImageResize[RemoveAlphaChannel[i], 500]; dims = ImageDimensions[i0]; (* smoothing *) i1 = MeanShiftFilter[i0, 3, .05, MaxIterations-...


4

Rather than trying to process the puzzle image, we can work with the procedure that produced it (from Vasiliy Kaurov's wonderful blog page Designing Jigsaw Puzzles with Mathematica). Two things we need to add: (1) We need to get polygon primitives with wiggled edges rather than lines, and (2) We need to use the input image as Texture for polygon primitives ...


2

Not particularly efficient buy an easy to write recursion ClearAll[splitMerge] splitMerge[i_, maxSt_, minSize_, newImage_] := ImageAssemble@Map[If[ And[ Max@ImageMeasurements[#, "StandardDeviation"] > maxSt, And @@ Thread[ImageDimensions[#] > minSize] ], splitMerge[ImagePartition[#, {Scaled[{1/2, 1/2}]}], maxSt, ...


2

I was able to do it using Texture, hk0 = Texture@ Show[ListDensityPlot[Shk0, InterpolationOrder -> 1, AspectRatio -> Automatic, ColorFunction -> ColorData["SunsetColors"]], hk0Outline, Frame -> False]; hhl = Texture@ Show[ListDensityPlot[Shhl, InterpolationOrder -> 1, AspectRatio -> 1/Sqrt[2], ...


1

Generally, I really recommend image processing docs - lots useful stuff there: http://reference.wolfram.com/language/guide/ImageProcessing.html http://reference.wolfram.com/language/guide/ColorProcessing.html DistanceTransform resolution depends on your original image resolution which you can control in Graphics: dpts = ImageAdjust[DistanceTransform[...


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