Skip to main content
added 69 characters in body
Source Link
Kuba
  • 137.7k
  • 13
  • 289
  • 751

Not sure what an outline really is so maybe:

Composition[
  
   Graphics[{PointSize@SmallGraphics[GraphicsComplex[#, Point@#}Line@Last@FindShortestTour@#], Frame -> True] &
  
  , Function[image, 
       Transpose @ MapThread[
            Rescale[#, {#2, #3}, {##4}] &, 
            {#Transpose[#], {0., 0.}, ImageDimensions@image, 
             Sequence @@ Transpose@{{5, 25}, {13, 25}}}
        ] & /@ PixelValuePositions[image, 1]
    ]
  
  ,  Binarize
  , Thinning
  , EdgeDetect
  , Binarize
  , ColorNegate
  , Rasterize[#, ImageSize -> 500] &
  
  ] @ Graphics[
  spoly,
  PlotRange -> {{5, 25}, {13, 25}},
  ImageMargins -> 0]

enter image description hereenter image description here

Not sure what an outline really is so maybe:

Composition[
  
   Graphics[{PointSize@Small, Point@#}, Frame -> True] &
  
  , Function[image, 
        MapThread[
           Rescale[#, {#2, #3}, {##4}] &,
           {#, {0, 0}, ImageDimensions@image, Sequence @@ Transpose@{{5, 25}, {13, 25}}}
      ] & /@ PixelValuePositions[image, 1]
   ]
  
  ,  Binarize
  , Thinning
  , EdgeDetect
  , Binarize
  , ColorNegate
  , Rasterize[#, ImageSize -> 500] &
  
  ] @ Graphics[
  spoly,
  PlotRange -> {{5, 25}, {13, 25}},
  ImageMargins -> 0]

enter image description here

Not sure what an outline really is so maybe:

Composition[
  
   Graphics[GraphicsComplex[#, Line@Last@FindShortestTour@#], Frame -> True] &
  
  , Function[image,
       Transpose @ MapThread[
            Rescale[#, {#2, #3}, {##4}] &, 
            {Transpose[#], {0., 0.}, ImageDimensions@image, 
             Sequence @@ Transpose@{{5, 25}, {13, 25}}}
        ] & @ PixelValuePositions[image, 1]
    ]
  
  ,  Binarize
  , Thinning
  , EdgeDetect
  , Binarize
  , ColorNegate
  , Rasterize[#, ImageSize -> 500] &
  
  ] @ Graphics[
  spoly,
  PlotRange -> {{5, 25}, {13, 25}},
  ImageMargins -> 0]

enter image description here

Source Link
Kuba
  • 137.7k
  • 13
  • 289
  • 751

Not sure what an outline really is so maybe:

Composition[
  
   Graphics[{PointSize@Small, Point@#}, Frame -> True] &
  
  , Function[image, 
        MapThread[
           Rescale[#, {#2, #3}, {##4}] &,
           {#, {0, 0}, ImageDimensions@image, Sequence @@ Transpose@{{5, 25}, {13, 25}}}
      ] & /@ PixelValuePositions[image, 1]
   ]
  
  ,  Binarize
  , Thinning
  , EdgeDetect
  , Binarize
  , ColorNegate
  , Rasterize[#, ImageSize -> 500] &
  
  ] @ Graphics[
  spoly,
  PlotRange -> {{5, 25}, {13, 25}},
  ImageMargins -> 0]

enter image description here