Skip to content

Draw any shape from an image by Fourier transform using only Matplotlib.

Notifications You must be signed in to change notification settings

staghado/fourier-draw

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fourier-draw

Implementation of a technique allowing to draw the contour of any image using the Fourier transform.

How to use it ?

usage: \

  • fourier-draw.py [-h] -i INPUT -o OUTPUT [-f FRAMES] [-N N]

arguments:

  -h, --help            show this help message and exit
  -i INPUT, --input INPUT
                        input image path
  -o OUTPUT, --output OUTPUT
                        output animation path
  -f FRAMES, --frames FRAMES
                        number of frames
  -N N, --N N           number of coefficients used

Example

  • Input image :

  • Output animation :

Improvements :

After the extraction of the contours, I only take the largest one for simplicity. But if we wanted to reproduce more fine-grained details one would need to use all the available contours. In order to do that, we could simply stack all the contours into one big contour but that does not work pretty well since the naive stacking of contours adds more lines which make the final animation cumbersome.

We would like to connect the contours so as to minimize the intersection between the lines.

Reference :

About

Draw any shape from an image by Fourier transform using only Matplotlib.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published