Coder Social home page Coder Social logo

0x09 / dspfun Goto Github PK

View Code? Open in Web Editor NEW
20.0 3.0 2.0 294 KB

Set of *nix utilities for experimentation and learning about spectral analysis of images

License: MIT License

Makefile 2.96% C 97.04%
spectral-analysis fourier-series fourier-analysis signal-processing image-processing digital-signal-processing

dspfun's Introduction

DSP Funbox - Set of *nix utilities for experimentation and learning about spectral analysis of images.

dspfun
8x8 DFT basis created with genbasis

Overview

dspfun is a loosely related collection of commandline tools built to help visualize or test various aspects of 2- and 3-dimensional signal processing in the frequency domain.
Each set of tools aims to cover a specific aspect of this — such as visualizing the basis functions of transforms or generating spectrograms — and including things that are not necessarily practical but may be interesting to experiment with.

Toolsets

  • spec - Generate DCT spectrums for viewing or invertible spectrums for editing in a regular image editor.
  • motion - 3-dimensional frequency-space editor for video.
  • applybasis - Tools for working with basis functions of a variety of 2D transforms.
  • zoom - Interpolate images against a cosine basis.
  • scan - Progressively reconstruct images using various frequency space scans.

See each toolset for additional info about it.

Dependencies

Other than a Unix-like build environment, most tools in this framework depend on libraries from one or more of these projects:

Building

Running

make

From the top level will build each project. Alternatively each project may be built independently with the Makefile in its directory.

Common conventions

Usage for each set of tools is described in its own README, but these follow some common conventions and often share functionality, especially with respect to input and output.

Image and video I/O

ImageMagick is used for image input and output, so any formats and specifiers supported by it (e.g. png:- for png pipe output) may be used. All tools which produce image output default to Sixel graphics for inline display if the output is a terminal.

FFmpeg's libraries are used for video input and output and so likewise formats supported by it are accepted. Tools which output video also accept a special argument ffplay: instead of a file or pipe to display raw video output using the ffplay binary. This will configure ffplay with the correct color properties for the output so may be preferable to e.g. piping yuv4mpeg.

Configurable floating point precision

The internal floating point precision for all tools may be configured at compile time by setting make vars COEFF_PRECISION and INTERMEDIATE_PRECISION with a value of F, D, or L for float, double, or long double. This is intended to allow for some simple configurability of tools' speed and memory use vs precision, or simply to see how different levels of precision affect results.
These define the precision used for FFTW transforms and storage buffers (coeff precision), and for intermediate calculations (intermediate precision.) Specifying these is optional and each project that can be configured this way has defaults appropriate for it.

Linear light processing

Most tools process in the input's colorspace by default, but offer the option to process in linear RGB. For tools that support this it can be enabled with the -g (for gamma correct) short option or --linear long option.

dspfun's People

Contributors

0x09 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

akemi ganlubbq

dspfun's Issues

When I run make I got an error.

After I run make in dspfun directory i got:

home/dspfun$ make
make -C spec
make[1]: Entering directory 'home/dspfun/spec'
cc -std=c11 -Ofast -I../include/ -D_GNU_SOURCE -DMAGICKWAND_VERSION=6 -fopenmp -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 -fopenmp -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 -I/usr/include/x86_64-linux-gnu//ImageMagick-6 -I/usr/include/ImageMagick-6 -I/usr/include/x86_64-linux-gnu//ImageMagick-6 -I/usr/include/ImageMagick-6 -lMagickWand-6.Q16 -lMagickCore-6.Q16 -lfftw3 -lm -o spec spec.c
In file included from spec.c:6:0:
spec.h: In function ‘spec_args’:
spec.h:101:5: warning: ignoring return value of ‘asprintf’, declared with attribute warn_unused_result [-Wunused-result]
asprintf(&opts.help,"-g -c csp -t (%s) -R (%s) -T (%s) -S (%s) -G (%s(float)) ",
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
enum_keys(spectype),enum_keys(rangetype),enum_keys(scaletype),enum_keys(signtype),enum_keys(gaintype));
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/ccIj1v55.o: In function main': spec.c:(.text.startup+0x516): undefined reference to MagickWandGenesis'
spec.c:(.text.startup+0x51b): undefined reference to NewMagickWand' spec.c:(.text.startup+0x529): undefined reference to MagickReadImage'
spec.c:(.text.startup+0x531): undefined reference to MagickGetImageWidth' spec.c:(.text.startup+0x543): undefined reference to MagickGetImageHeight'
spec.c:(.text.startup+0x598): undefined reference to fftw_alloc_real' spec.c:(.text.startup+0x5bf): undefined reference to MagickExportImagePixels'
spec.c:(.text.startup+0x5c7): undefined reference to DestroyMagickWand' spec.c:(.text.startup+0x613): undefined reference to fftw_plan_many_r2r'
spec.c:(.text.startup+0x622): undefined reference to fftw_execute' spec.c:(.text.startup+0x632): undefined reference to fftw_destroy_plan'
spec.c:(.text.startup+0x95f): undefined reference to NewMagickWand' spec.c:(.text.startup+0x988): undefined reference to MagickConstituteImage'
spec.c:(.text.startup+0x990): undefined reference to fftw_free' spec.c:(.text.startup+0xcb6): undefined reference to MagickSetImageProperty'
spec.c:(.text.startup+0xcc5): undefined reference to MagickWriteImage' spec.c:(.text.startup+0xccd): undefined reference to DestroyMagickWand'
spec.c:(.text.startup+0xcd2): undefined reference to MagickWandTerminus' spec.c:(.text.startup+0xdfa): undefined reference to log1p'
spec.c:(.text.startup+0xe7a): undefined reference to log1pl' spec.c:(.text.startup+0xf07): undefined reference to MagickTransformImageColorspace'
collect2: error: ld returned 1 exit status
Makefile:10: recipe for target 'spec' failed
make[1]: *** [spec] Error 1
make[1]: Leaving directory home/dspfun/spec'
Makefile:8: recipe for target 'spec' failed
make: *** [spec] Error 2

I have installed FFTW, ImageMagick.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.