Coder Social home page Coder Social logo

image_convolution's Introduction

Image Convolution

This was created for a parallel programming assignment at DSU. The main code is written in C with OpenMP. It uses Sean T. Barrett's libraries for image manipulation.. The front-end is in Node, using node-ffi to bind to the C code. The Scientist and Engineer's Guide to Digital Signal Processing was indispensable in understanding convolution, and in providing good kernel examples.

Disclaimers

I was a complete novice at Node when I made this, and the time to learn it appropriately was very limited. I followed this tutorial and that's pretty much it. Transferring images from the client to the server is very, very slow.* I am not sure why, but any attempt to clear out the node-modules folder and reinstall with npm introduces bugs. If you want to fix that for some reason, here's what I believe the dependencies are:

  "dependencies" :
    { "express" : "^4.14.0" ,
      "body-parser" : "^1.15.2" ,
      "ffi" : "^2.2.0" ,
      "ref" : "^1.3.3" ,
      "ref-struct" :"^1.1.0" ,
      "ref-array" : "^1.2.0" ,
      "pug" : "^2.0.0-beta6"
    }

Usage

Anyway, it should work if you copy it as-is, cd to web, and run node index.js. Select an image, mess with the settings, and click go. For example, try entering this for the convolution kernel:

0 0 0
0 1 0
0 0 -1

and leave the divisor as 1. After you've picked an image, click "Go". If everything is working, then the server should output something like this:

Divisor: 1
Kernel:
0.000000	0.000000	0.000000	
0.000000	1.000000	0.000000	
0.000000	0.000000	-1.000000	
Image width: 800, height: 600, components: 4

and after a few seconds/minutes, your original image will be replaced in the canvas by your convolved image.

  • IIRC, raw image data is transferred from client to server in JSON. I tried to look into Streams, but it was a bit too much effort at the time. Now I think looking into compression would also be a good idea, at least maybe gzip.

image_convolution's People

Contributors

metaphorshear avatar

Watchers

James Cloos avatar  avatar

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.