Skip to main content
added 32 characters in body; edited title
Source Link
Vitaliy Kaurov
  • 73.4k
  • 9
  • 206
  • 365

complete Complete contours (outline) from a image

I want to find the contours of (parts) image and sent the output to a lasercutterlaser cutter.

  For example, take this image:

[![enter image description here][1]][1]enter image description here

I use this code:

maskv1 = AlphaChannel[RemoveBackground[bal1]]; contours =
ImageMeasurements[ EdgeDetect[Blur[ImageMultiply[bal1, maskv1], 2], 1], "Contours"]; bal4 = ImageGraphics[ ColorNegate[
DeleteSmallComponents[ Dilation[ EdgeDetect[BilateralFilter[Graphics[contours], 7, .1]], .6], Method -> "Mean"]], ImageSize -> 600];

maskv1 = AlphaChannel[RemoveBackground[bal1]];
 contours =  
 ImageMeasurements[   EdgeDetect[Blur[ImageMultiply[bal1, maskv1], 2],
 1], "Contours"]; bal4 = ImageGraphics[   ColorNegate[   
 DeleteSmallComponents[
     Dilation[
      EdgeDetect[BilateralFilter[Graphics[contours], 7, .1]], .6], 
     Method -> "Mean"]], ImageSize -> 600];

The output is: [![enter image description here][2]][2]

enter image description here

The red line is done by myself. As you can see, the contour is not closed. The desired output is something like:

[![enter image description here][3]][3]enter image description here

So I need a function to close the outline/contour. Who has a suggestion to do this? [1]: https://i.sstatic.net/O14tf.jpg [2]: https://i.sstatic.net/2NQCF.jpg [3]: https://i.sstatic.net/gwATo.jpg

complete contours (outline) from a image

I want to find the contours of (parts) image and sent the output to a lasercutter.

  For example, take this image:

[![enter image description here][1]][1]

I use this code:

maskv1 = AlphaChannel[RemoveBackground[bal1]]; contours =
ImageMeasurements[ EdgeDetect[Blur[ImageMultiply[bal1, maskv1], 2], 1], "Contours"]; bal4 = ImageGraphics[ ColorNegate[
DeleteSmallComponents[ Dilation[ EdgeDetect[BilateralFilter[Graphics[contours], 7, .1]], .6], Method -> "Mean"]], ImageSize -> 600];

The output is: [![enter image description here][2]][2]

The red line is done by myself. As you can see, the contour is not closed. The desired output is something like:

[![enter image description here][3]][3]

So I need a function to close the outline/contour. Who has a suggestion to do this? [1]: https://i.sstatic.net/O14tf.jpg [2]: https://i.sstatic.net/2NQCF.jpg [3]: https://i.sstatic.net/gwATo.jpg

Complete contours (outline) from a image

I want to find the contours of (parts) image and sent the output to a laser cutter. For example, take this image:

enter image description here

I use this code:

maskv1 = AlphaChannel[RemoveBackground[bal1]];
 contours =  
 ImageMeasurements[   EdgeDetect[Blur[ImageMultiply[bal1, maskv1], 2],
 1], "Contours"]; bal4 = ImageGraphics[   ColorNegate[   
 DeleteSmallComponents[
     Dilation[
      EdgeDetect[BilateralFilter[Graphics[contours], 7, .1]], .6], 
     Method -> "Mean"]], ImageSize -> 600];

The output is:

enter image description here

The red line is done by myself. As you can see, the contour is not closed. The desired output is something like:

enter image description here

So I need a function to close the outline/contour. Who has a suggestion to do this?

Source Link

complete contours (outline) from a image

I want to find the contours of (parts) image and sent the output to a lasercutter.

For example, take this image:

[![enter image description here][1]][1]

I use this code:

maskv1 = AlphaChannel[RemoveBackground[bal1]]; contours =
ImageMeasurements[ EdgeDetect[Blur[ImageMultiply[bal1, maskv1], 2], 1], "Contours"]; bal4 = ImageGraphics[ ColorNegate[
DeleteSmallComponents[ Dilation[ EdgeDetect[BilateralFilter[Graphics[contours], 7, .1]], .6], Method -> "Mean"]], ImageSize -> 600];

The output is: [![enter image description here][2]][2]

The red line is done by myself. As you can see, the contour is not closed. The desired output is something like:

[![enter image description here][3]][3]

So I need a function to close the outline/contour. Who has a suggestion to do this? [1]: https://i.sstatic.net/O14tf.jpg [2]: https://i.sstatic.net/2NQCF.jpg [3]: https://i.sstatic.net/gwATo.jpg