Wolfram Language

Use Contours to Make Hand Drawings

A shape can be represented by its Fourier descriptors, computed as the Fourier of the contour points represented as complex numbers. The inverse Fourier transform can then be used to reconstruct the original contour. Reconstruction using fewer terms can filter details, resulting in smoother contours. Fourier descriptors have been used to create a hand drawing of objects in images.

Compute Fourier descriptors of a contour containing components using Fourier computed on the contour points converted to complex numbers .

Use InverseFourier to construct the contour from its Fourier descriptors.

Using the new "Contours" property present in ComponentMeasurements, it is possible to extract all the oriented contours in a single step.

Finally, you can compute some number of Fourier descriptors for each contour and use them to reconstruct the contour. The more descriptors you use, the more accurate the reconstruction will be.

The same procedure can be applied to a more complex image.

Combine different reconstructions for each contour to get a sketch-like appearance.

Related Examples

de es fr ja ko pt-br zh