Tag Info

New answers tagged

5

Prolog You can use Prolog and Inset which avoids rasterizing the GeoGraphics: lena = ExampleData[{"TestImage", "Lena"}]; GeoGraphics[Polygon[Entity["Country", "Canada"]], GeoProjection -> {"Orthographic", "Centering" -> {0, -97}}, Prolog -> Inset[Image[lena, ImageSize -> 500]]] RemoveBackground RemoveBackground works on GeoGraphics; ...


13

Update Silvia proposed a much faster algorithm that I believe produces I uniform distribution. Here is my implementation of it. pointsInMask2[mask_Image, n_Integer, range : {_, _} : {0, 1/2}] := Reverse @ ImageData @ Binarize[mask, range]\[Transpose] // SparseArray[#]["NonzeroPositions"] & // RandomChoice[#, n] + RandomReal[{-1, 0}, {n, 2}] ...


10

Following up on my comment and borrowing a method from Vectorizing an image like "Trace Bitmap" in Inkscape: mask = Binarize @ Import["http://i.stack.imgur.com/yoPNX.png"]; {row, col} = ImageDimensions[mask]; intf = ListInterpolation @ Reverse @ ImageData @ mask; region = DiscretizeGraphics @ RegionPlot[intf[c, r] < 1/2, {r, 1, row}, {c, ...



Top 50 recent answers are included