SlideShare una empresa de Scribd logo
1 de 16
IMAGE
MANIPULATION WITH
NODE.JS


Presenter: Amit Singhai
Contents of this workshop

• Introduction
• Inspiration behind this stuff
• Pre-requisites before proceeding further
• Hands on session – Basic
• Hands on session – Advanced
• Adding real time features with now.js
• Face Detection
• Options for performance
• Future work
Introduction

Image manipulation/processing using “node.js” and “graphics
magick” node module.

Using Opencv for little more fun.


What does this mean?? image manipulation???
         •   Reading and changing image attributes
         •   Effects & Transformations
         •   Thumbnail generation / resizing
         •   Drawing
         •   Etc…….
Inspiration
• Node community
Pre-requisites
Node.js
 - Created by Ryan Dahl in 2009
 - Its open source
 - Runs on Google V8
 - Server side Java Script
 - Event based IO
NPM
 - to install node modules ( a kind of package manager)
Pre-requisite
Graphics Magick or Image Magick
 - It’s a software suit for image editing
 - brew install imagemagick [sudo apt-get for ubuntu, yum for
centos]

gm node module
 - node module to access Graphics magick functionality using
nodejs
 - npm install gm
Pre-requisite
Now.js
 - java script middleware

Ejs
 - Html rendering in JSP style
Hands on session – Basic
-   Logging image properties
-   Resizing
-   Croping
-   Format conversion
Hands on session – Advanced
- Effects
- Transformations
- Thumbnail generation
Adding real time features with now.js
Face detection with Node and opencv
1. brew install opencv
2. Sudo npm install opencv –g




var cv = require('opencv');
var COLOR = [0, 255, 0]; //default red
var thickness = 2; // default 1
cv.readImage('./mona.png', function(err, im) {
im.detectObject('../data/haarcascade_frontalface_alt2.xml', {}, function(err, faces) {

      for(var k = 0; k < faces.length; k++) {
          face = faces[k];
          im.rectangle([face.x, face.y], [face.x + face.width, face.y + face.height], COLOR, 2);
      }
      im.save('./detected.png');
});
});
Face detection with Node and opencv
Options for performance


1. Use cluster module


2. http server and image processing are in separate instances of node
Ideas for Further enhancements
-   Running on embedded linux (possibly on raspberry-pi and make it open source)

-   Running on android by porting graphics magick and now.js to android

-   Adding some more features for smooth image streaming over the network

-   Dealing with very large images

-   iPhoto integration
Thank you



Mail: amitsinghai.jain@gmail.com

Code: http://github.com/amuxtux

      Happily use it or if you want you may contribute.

Más contenido relacionado

Similar a Image manipulationworkshop amit

Introduction to the Java(TM) Advanced Imaging API
Introduction to the Java(TM) Advanced Imaging APIIntroduction to the Java(TM) Advanced Imaging API
Introduction to the Java(TM) Advanced Imaging APIwhite paper
 
Image video processing and canvas element by Abhay Rao
Image video processing and canvas element by Abhay RaoImage video processing and canvas element by Abhay Rao
Image video processing and canvas element by Abhay RaoMrinmay Kulkarni
 
JS digest. February 2017
JS digest. February 2017JS digest. February 2017
JS digest. February 2017ElifTech
 
2015: A static site generator odyssey
2015: A static site generator odyssey2015: A static site generator odyssey
2015: A static site generator odysseyOlga Skurativska
 
2015 - a static site generator odyssey
2015  - a static site generator odyssey2015  - a static site generator odyssey
2015 - a static site generator odysseyUnic
 
A Tutorial On Ip 2
A Tutorial On Ip 2A Tutorial On Ip 2
A Tutorial On Ip 2ankuredkie
 
blueMarine a desktop app for the open source photographic workflow
blueMarine  a desktop app for the open source photographic workflowblueMarine  a desktop app for the open source photographic workflow
blueMarine a desktop app for the open source photographic workflowFabrizio Giudici
 
Advanced Web Graphics with Canvas
Advanced Web Graphics with CanvasAdvanced Web Graphics with Canvas
Advanced Web Graphics with CanvasJason Harwig
 
Jwis2011 ruo ando
Jwis2011 ruo andoJwis2011 ruo ando
Jwis2011 ruo andoRuo Ando
 
Image Magic for PowerBuilder
Image Magic for PowerBuilderImage Magic for PowerBuilder
Image Magic for PowerBuilderMarco Cimaroli
 
Deep Learning on iOS #360iDev
Deep Learning on iOS #360iDevDeep Learning on iOS #360iDev
Deep Learning on iOS #360iDevShuichi Tsutsumi
 
Leaving Flatland: Getting Started with WebGL- SXSW 2012
Leaving Flatland: Getting Started with WebGL- SXSW 2012Leaving Flatland: Getting Started with WebGL- SXSW 2012
Leaving Flatland: Getting Started with WebGL- SXSW 2012philogb
 
Enhanced Human Computer Interaction using hand gesture analysis on GPU
Enhanced Human Computer Interaction using hand gesture analysis on GPUEnhanced Human Computer Interaction using hand gesture analysis on GPU
Enhanced Human Computer Interaction using hand gesture analysis on GPUMahesh Khadatare
 
How I learned to stop worrying and love embedding JavaScript
How I learned to stop worrying and love embedding JavaScriptHow I learned to stop worrying and love embedding JavaScript
How I learned to stop worrying and love embedding JavaScriptKevin Read
 
Embedding V8 in Android apps with Ejecta-V8
Embedding V8 in Android apps with Ejecta-V8Embedding V8 in Android apps with Ejecta-V8
Embedding V8 in Android apps with Ejecta-V8Kevin Read
 
blueMarine photographic workflow with Java
blueMarine photographic workflow with JavablueMarine photographic workflow with Java
blueMarine photographic workflow with JavaFabrizio Giudici
 
Advanced Ruby Scripting For Sketch Up
Advanced Ruby Scripting For Sketch UpAdvanced Ruby Scripting For Sketch Up
Advanced Ruby Scripting For Sketch UpGoogleTecTalks
 

Similar a Image manipulationworkshop amit (20)

Introduction to the Java(TM) Advanced Imaging API
Introduction to the Java(TM) Advanced Imaging APIIntroduction to the Java(TM) Advanced Imaging API
Introduction to the Java(TM) Advanced Imaging API
 
Image video processing and canvas element by Abhay Rao
Image video processing and canvas element by Abhay RaoImage video processing and canvas element by Abhay Rao
Image video processing and canvas element by Abhay Rao
 
JS digest. February 2017
JS digest. February 2017JS digest. February 2017
JS digest. February 2017
 
2015: A static site generator odyssey
2015: A static site generator odyssey2015: A static site generator odyssey
2015: A static site generator odyssey
 
2015 - a static site generator odyssey
2015  - a static site generator odyssey2015  - a static site generator odyssey
2015 - a static site generator odyssey
 
A Tutorial On Ip 2
A Tutorial On Ip 2A Tutorial On Ip 2
A Tutorial On Ip 2
 
OpenCV+Android.pptx
OpenCV+Android.pptxOpenCV+Android.pptx
OpenCV+Android.pptx
 
blueMarine a desktop app for the open source photographic workflow
blueMarine  a desktop app for the open source photographic workflowblueMarine  a desktop app for the open source photographic workflow
blueMarine a desktop app for the open source photographic workflow
 
Advanced Web Graphics with Canvas
Advanced Web Graphics with CanvasAdvanced Web Graphics with Canvas
Advanced Web Graphics with Canvas
 
Jwis2011 ruo ando
Jwis2011 ruo andoJwis2011 ruo ando
Jwis2011 ruo ando
 
Image Magic for PowerBuilder
Image Magic for PowerBuilderImage Magic for PowerBuilder
Image Magic for PowerBuilder
 
Deep Learning on iOS #360iDev
Deep Learning on iOS #360iDevDeep Learning on iOS #360iDev
Deep Learning on iOS #360iDev
 
Leaving Flatland: Getting Started with WebGL- SXSW 2012
Leaving Flatland: Getting Started with WebGL- SXSW 2012Leaving Flatland: Getting Started with WebGL- SXSW 2012
Leaving Flatland: Getting Started with WebGL- SXSW 2012
 
Node azure
Node azureNode azure
Node azure
 
Training Seminar
Training SeminarTraining Seminar
Training Seminar
 
Enhanced Human Computer Interaction using hand gesture analysis on GPU
Enhanced Human Computer Interaction using hand gesture analysis on GPUEnhanced Human Computer Interaction using hand gesture analysis on GPU
Enhanced Human Computer Interaction using hand gesture analysis on GPU
 
How I learned to stop worrying and love embedding JavaScript
How I learned to stop worrying and love embedding JavaScriptHow I learned to stop worrying and love embedding JavaScript
How I learned to stop worrying and love embedding JavaScript
 
Embedding V8 in Android apps with Ejecta-V8
Embedding V8 in Android apps with Ejecta-V8Embedding V8 in Android apps with Ejecta-V8
Embedding V8 in Android apps with Ejecta-V8
 
blueMarine photographic workflow with Java
blueMarine photographic workflow with JavablueMarine photographic workflow with Java
blueMarine photographic workflow with Java
 
Advanced Ruby Scripting For Sketch Up
Advanced Ruby Scripting For Sketch UpAdvanced Ruby Scripting For Sketch Up
Advanced Ruby Scripting For Sketch Up
 

Image manipulationworkshop amit

  • 2. Contents of this workshop • Introduction • Inspiration behind this stuff • Pre-requisites before proceeding further • Hands on session – Basic • Hands on session – Advanced • Adding real time features with now.js • Face Detection • Options for performance • Future work
  • 3. Introduction Image manipulation/processing using “node.js” and “graphics magick” node module. Using Opencv for little more fun. What does this mean?? image manipulation??? • Reading and changing image attributes • Effects & Transformations • Thumbnail generation / resizing • Drawing • Etc…….
  • 5. Pre-requisites Node.js - Created by Ryan Dahl in 2009 - Its open source - Runs on Google V8 - Server side Java Script - Event based IO NPM - to install node modules ( a kind of package manager)
  • 6.
  • 7. Pre-requisite Graphics Magick or Image Magick - It’s a software suit for image editing - brew install imagemagick [sudo apt-get for ubuntu, yum for centos] gm node module - node module to access Graphics magick functionality using nodejs - npm install gm
  • 8. Pre-requisite Now.js - java script middleware Ejs - Html rendering in JSP style
  • 9. Hands on session – Basic - Logging image properties - Resizing - Croping - Format conversion
  • 10. Hands on session – Advanced - Effects - Transformations - Thumbnail generation
  • 11. Adding real time features with now.js
  • 12. Face detection with Node and opencv 1. brew install opencv 2. Sudo npm install opencv –g var cv = require('opencv'); var COLOR = [0, 255, 0]; //default red var thickness = 2; // default 1 cv.readImage('./mona.png', function(err, im) { im.detectObject('../data/haarcascade_frontalface_alt2.xml', {}, function(err, faces) { for(var k = 0; k < faces.length; k++) { face = faces[k]; im.rectangle([face.x, face.y], [face.x + face.width, face.y + face.height], COLOR, 2); } im.save('./detected.png'); }); });
  • 13. Face detection with Node and opencv
  • 14. Options for performance 1. Use cluster module 2. http server and image processing are in separate instances of node
  • 15. Ideas for Further enhancements - Running on embedded linux (possibly on raspberry-pi and make it open source) - Running on android by porting graphics magick and now.js to android - Adding some more features for smooth image streaming over the network - Dealing with very large images - iPhoto integration
  • 16. Thank you Mail: amitsinghai.jain@gmail.com Code: http://github.com/amuxtux Happily use it or if you want you may contribute.