2023, Till Bovermann
A python script that extracts contours from an image and generates a wav file for each contour.
git clone [email protected]:tai-studio/contours2wav.git
cd contours2wav
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
Before usage, make sure to activate the virtual environment:
source venv/bin/activate
alternatively, you can use the venv/bin/python
command:
venv/bin/python contour2wav.py -m100 -n50000 -t 110 infile.jpg outDir
python contour2wav.py -m100 -n50000 -t 110 infile.jpg outDir
for file in ../_assets/*.jpg; do python contour2wav.py -m100 -n50000 -t 110 $file ../_renders; done
usage: contour2wav.py [-h] [-m MINPOINTS] [-n MAXPOINTS] [-t THRESHOLD] [-s NUMSAMPLES] [-r SAMPLERATE] infile outdir
positional arguments:
infile input image file
outdir final result will be saved to outdir/infile
options:
-h, --help show this help message and exit
-m MINPOINTS, --minPoints MINPOINTS
-n MAXPOINTS, --maxPoints MAXPOINTS
-t THRESHOLD, --threshold THRESHOLD
-s NUMSAMPLES, --numSamples NUMSAMPLES
-r SAMPLERATE, --sampleRate SAMPLERATE
- Anja Riese for triggering the idea
- OpenCV
- NumPy
- scipy