SlideShare a Scribd company logo
Analyzing
Japanese Art
with Node.js
and Computer
Vision
John Resig
EmpireJS: Hacking Art with Node js and Image Analysis
EmpireJS: Hacking Art with Node js and Image Analysis
EmpireJS: Hacking Art with Node js and Image Analysis
EmpireJS: Hacking Art with Node js and Image Analysis
EmpireJS: Hacking Art with Node js and Image Analysis
EmpireJS: Hacking Art with Node js and Image Analysis
EmpireJS: Hacking Art with Node js and Image Analysis
EmpireJS: Hacking Art with Node js and Image Analysis
EmpireJS: Hacking Art with Node js and Image Analysis
EmpireJS: Hacking Art with Node js and Image Analysis
EmpireJS: Hacking Art with Node js and Image Analysis
EmpireJS: Hacking Art with Node js and Image Analysis
EmpireJS: Hacking Art with Node js and Image Analysis
EmpireJS: Hacking Art with Node js and Image Analysis
EmpireJS: Hacking Art with Node js and Image Analysis
Lot 55: 20 Japanese Woodblock Prints
Each depicting a female/Geisha figure with
calligraphy throughout each print. Prints
measure 13.75" H x 9.375" W. Toning to
each print, some losses around edges.
Estimated Price: $400 - $600
Step 1: Acquire and read tons of expensive books.
Step 2: Learn to read Japanese. *
Japanese from the 17th to 19th century. *
You’re not going to learn this from Rosetta Stone.
Step 3: Learn to read Japanese calligraphy.
Solution: A fast-loading, responsive, i18ned, web
site: Ukiyo-e.org
EmpireJS: Hacking Art with Node js and Image Analysis
EmpireJS: Hacking Art with Node js and Image Analysis
EmpireJS: Hacking Art with Node js and Image Analysis
EmpireJS: Hacking Art with Node js and Image Analysis
https://github.com/jeresig/i18n-node-2
var greeting = i18n.__('Hello %s, how are you
today?', 'Marcus');
i18n.__n('%s cat', '%s cats', 3);
Node i18n 2 (npm install i18n-2)
setLocaleFromSubdomain([request])
https://github.com/jeresig/i18n-node-2
{!
"Hello": "Hello",!
"Hello %s, how are you today?": "Hello %s, how are you today?",!
"weekend": "weekend",!
"Hello %s, how are you today? How was your %s.": "Hello %s, how
are you today? How was your %s.",!
"Hi": "Hi",!
"Howdy": "Howdy",!
"%s cat": {!
"one": "%s cat",!
"other": "%s cats"!
},!
"There is one monkey in the %%s": {!
"one": "There is one monkey in the %%s",!
"other": "There are %d monkeys in the %%s"!
},!
"tree": "tree"!
}!
Node i18n 2 (npm install i18n-2)
Digital Ocean
Amazon S3
Amazon Cloudfront
Digital Ocean
Images
Data

(HTML,
XML, JSON)
Images JS, CSS
Images JS, CSS
nginx
(w/ cache)
node.js
express
node.js
express
naught
mongodb
Elastic

Search
Scraper
EmpireJS: Hacking Art with Node js and Image Analysis
https://github.com/jeresig/jquery-imgscrubber
Collecting Tons of Woodblock Print Data
Search
Page Page Page
HTML
Image
HTML
Image
HTML
Image
Search
Page Page Page
HTML
Image
HTML
Image
HTML
Image
Queue-based Crawling using PhantomJS
Processing Queue
Some Website
WebKit
PhantomJS
CasperJS
SpookyJS
Save Data
XML Files
Mongo Log
libxml (+ xpath)
MongoDB
Extract Data
Process Data
Artists
Images
Correct Artist
and Date
Add to Site!
module.exports = function() {!
return {!
scrape: [!
{!
start: "http://ukiyo-e.org/search",!
visit: "//a[@class='img']",!
next: "//a[contains(@rel,'next')]"!
},!
{!
extract: {!
"title": "//p[contains(@class, 'title')]//span",!
"dateCreated": "//p[contains(@class, 'date')]//span",!
"artists[]": "//p[contains(@class, 'artist')]//a",!
"images[]": "//div[contains(@class,'imageholder')]//a/@href"!
}!
}!
]!
};!
};!
"surname" : "Hashimoto",
"surname_kana" : "はしもと",
"name" : "Hashimoto Okiie",
"ascii" : "Hashimoto Okiie",
"plain" : "Hashimoto Okiie",
"kana" : "はしもとおきいえ",
"_id" : ObjectId("530c0825d9a80976b2000437")
}
],
"names" : [
{
"original" : "Hashimoto Okiie (橋本興家)",
"locale" : "ja",
"kanji" : "橋本興家",
"given" : "Okiie",
"given_kana" : "おきいえ",
"surname" : "Hashimoto",
"surname_kana" : "はしもと",
"given_kanji" : "興家",
"surname_kanji" : "橋本",
"name" : "Hashimoto Okiie",
"ascii" : "Hashimoto Okiie",
"plain" : "Hashimoto Okiie",
"kana" : "はしもとおきいえ",
"_id" : ObjectId("530c0825d9a80976b2000439")
}
],
"extract" : [
"53dfc997cbf9fa7501d78e4820b24a9c"
],
"created" : ISODate("2014-02-25T03:04:05Z"),
"__v" : 0
}
“Stack Scraper”
https://github.com/jeresig/stack-scraper
https://github.com/jeresig/ukiyoe-scrapers
Image Similarity
https://github.com/jeresig/node-matchengine
EmpireJS: Hacking Art with Node js and Image Analysis
EmpireJS: Hacking Art with Node js and Image Analysis
EmpireJS: Hacking Art with Node js and Image Analysis
EmpireJS: Hacking Art with Node js and Image Analysis
EmpireJS: Hacking Art with Node js and Image Analysis
EmpireJS: Hacking Art with Node js and Image Analysis
EmpireJS: Hacking Art with Node js and Image Analysis
EmpireJS: Hacking Art with Node js and Image Analysis
Image Similarity Search
EmpireJS: Hacking Art with Node js and Image Analysis
EmpireJS: Hacking Art with Node js and Image Analysis
EmpireJS: Hacking Art with Node js and Image Analysis
EmpireJS: Hacking Art with Node js and Image Analysis
EmpireJS: Hacking Art with Node js and Image Analysis
EmpireJS: Hacking Art with Node js and Image Analysis
Idyll: Offline Image Cropping
• https://github.com/jeresig/idyll

• Crop images offline and on a mobile
device.

• Saves the selections back to a server.

• Data is synced and saved using HTML 5
appcache.

• https://github.com/jeresig/node-
appcache-glob
by David Chester

at Shutterstock
https://github.com/dchester/perl-image-crop-calibration-target
http://www.ersatzlabs.com/
Aiding Woodblock Print
Studies with Image Analysis
EmpireJS: Hacking Art with Node js and Image Analysis
EmpireJS: Hacking Art with Node js and Image Analysis
EmpireJS: Hacking Art with Node js and Image Analysis
EmpireJS: Hacking Art with Node js and Image Analysis
EmpireJS: Hacking Art with Node js and Image Analysis
EmpireJS: Hacking Art with Node js and Image Analysis
EmpireJS: Hacking Art with Node js and Image Analysis
EmpireJS: Hacking Art with Node js and Image Analysis
EmpireJS: Hacking Art with Node js and Image Analysis
EmpireJS: Hacking Art with Node js and Image Analysis
Correcting Print Data
Japanese Names
• Utagawa Hiroshige	

• Ando Hiroshige	

• Andō Hiroshige	

• Hiroshige	

• 歌川広重	

• 広重
安土
安堂
安島
安東
安籐
安藤
安道
安達
阿藤
Andō
安藤
andō
antō
anzō
yasuzuka
A many-to-many mapping!
Sharaku Toshusai
東洲斎写楽
Sharaku Toshusai
東洲斎写楽
Is this the family name?
Where are the stress marks?
How do you “split” this name?
Which name parts

correlate?
Tools (all are Node modules!)
• https://github.com/lovell/
hepburn

• https://github.com/jeresig/
node-enamdict

• https://github.com/jeresig/
node-ndlna

• https://github.com/jeresig/
node-romaji-name
ndlnahepburn enamdict
romaji-name
Hepburn
• https://github.com/lovell/
hepburn

• Takes in the English form of a
Japanese word.

• Returns it written in Hiragana or
Katakana (phonetic Japanese
alphabets).
ndlnahepburn enamdict
romaji-name
うたがわひろしげUtagawa Hiroshige
Enamdict
• https://github.com/jeresig/
node-enamdict

• Downloads and queries the
ENAMDICT database

• (A mapping of Japanese proper
names to Hiragana and
English.)

• Used to correct typos and figure
out surname/given name.
ndlnahepburn enamdict
romaji-name
NDLNA
• https://github.com/jeresig/
node-ndlna

• Queries the NDLNA database

• Finds the correct Kanji for an
English name.

• Or the correct English for a
Kanji name.
ndlnahepburn enamdict
romaji-name
ndlnahepburn enamdict
romaji-name
{
"original" : "Sharaku Toshusai (東洲斎写楽 )",
"locale" : "ja",
"kanji" : "東洲斎写楽",
"given" : "Sharaku",
"given_kana" : "しゃらく",
"surname" : "Tōshūsai",
"surname_kana" : "とおしゅうさい",
"surname_kanji" : "東洲斎",
"given_kanji" : "写楽",
"name" : "Tōshūsai Sharaku",
"ascii" : "Tooshuusai Sharaku",
"plain" : "Toshusai Sharaku",
"kana" : "とおしゅうさいしゃらく"
}
Dates
• https://github.com/jeresig/node-yearrange
var yr = require("yearrange");!
"
yr.parse("1877")!
// {"start": 1877, "end": 1877}!
"
yr.parse("1847-48")!
// {"start": 1847, "end": 1848}!
"
yr.parse("ca. 1810-20s")!
// {"start": 1810, "end": 1829, "circa": true}!
"
yr.parse("18th–19th century")!
// {"start": 1700, "end": 1899}!
"
yr.parse("Meiji era")!
// {"start": 1868, "end": 1912}
Artist Rectification
EmpireJS: Hacking Art with Node js and Image Analysis
EmpireJS: Hacking Art with Node js and Image Analysis
Miyagawa Shuntei
Printed in 1897
Sold for: $550
Prints sell for $100-$400 individually
True Estimate: $2100 - $8400 *
* You just have to find
someone willing to buy them!
EmpireJS: Hacking Art with Node js and Image Analysis
• http://ejohn.org/research/

• http://ukiyo-e.org/
• https://github.com/jeresig

More Related Content

PPTX
Paperjs presentation
PPTX
Introduction to Node.js
PPTX
introduction to node.js
PDF
How to write a well-behaved Python command line application
PDF
Using Objects to Organize your jQuery Code
PDF
Deploying Django with Ansible
PDF
Introduction to node js - From "hello world" to deploying on azure
PPTX
Introduction to Node js
Paperjs presentation
Introduction to Node.js
introduction to node.js
How to write a well-behaved Python command line application
Using Objects to Organize your jQuery Code
Deploying Django with Ansible
Introduction to node js - From "hello world" to deploying on azure
Introduction to Node js

Viewers also liked (20)

PDF
Node Foundation Membership Overview 20160907
PPT
PPTX
Japanese Kanji: A Shared, Visual Language
ZIP
Japan socials project
PPTX
Estudiantes
PPTX
Genki Kanji Mnemonics - Introduction
PPTX
Introduction to node.js
PPTX
Introduction to Node js
PPTX
From Hello World to Real World - Container Days Boston 2016
PPTX
Genki Kanji Mnemonics: L1 Kanji
PDF
GNU Parallel - Ole Tange
PDF
Denshi jisho
PDF
Nodejs vatsal shah
PDF
Learning Japanese Kanji: How Technology Can Help the Brain out
PDF
JBP2 / Lesson 2 / Kanji Look & Learn
PDF
Learning Japanese
PPT
Easy Japanese Kanji used for "school" settings
PPTX
Node js meetup
KEY
Node.js ― Hello, world! の1歩先へ。
Node Foundation Membership Overview 20160907
Japanese Kanji: A Shared, Visual Language
Japan socials project
Estudiantes
Genki Kanji Mnemonics - Introduction
Introduction to node.js
Introduction to Node js
From Hello World to Real World - Container Days Boston 2016
Genki Kanji Mnemonics: L1 Kanji
GNU Parallel - Ole Tange
Denshi jisho
Nodejs vatsal shah
Learning Japanese Kanji: How Technology Can Help the Brain out
JBP2 / Lesson 2 / Kanji Look & Learn
Learning Japanese
Easy Japanese Kanji used for "school" settings
Node js meetup
Node.js ― Hello, world! の1歩先へ。

Similar to EmpireJS: Hacking Art with Node js and Image Analysis (20)

PDF
Rv defcon25 keeping an eye on mobile applications - mikhail sosonkin
PDF
JavaScript Libraries: The Big Picture
PDF
[Longer ver] From Software to Hardware: How Do I Track My Cat with JavaScript
PDF
Incarnation - Turning Real World Objects into Perfume World
KEY
コードで学ぶドメイン駆動設計入門
PDF
Cross Platform Mobile Game Development
PPTX
GraphQL
PPTX
Game prototyping workshop
PDF
Hacking Art History
PDF
How to make Ajax Libraries work for you
PDF
Sylius, the good choice
PDF
Ruby on Rails - The Best Track for your Start Up
PDF
OPENVIS Conference Quick Report Part 2
PDF
[JS Kongress 2016] KittyCam.js - Raspberry Pi Camera w/ Cat Facial Detection
PDF
Metasepi team meeting #6: "Snatch-driven development"
PPTX
Hunting The Shadows: In Depth Analysis of Escalated APT Attacks
 
PDF
Symfony & Javascript. Combining the best of two worlds
PDF
Esoteric, Obfuscated, Artistic Programming in Ruby
PDF
PDF.JS at SwissJeese 2012
PDF
Canvas Only: Creative Coding in HTML5
Rv defcon25 keeping an eye on mobile applications - mikhail sosonkin
JavaScript Libraries: The Big Picture
[Longer ver] From Software to Hardware: How Do I Track My Cat with JavaScript
Incarnation - Turning Real World Objects into Perfume World
コードで学ぶドメイン駆動設計入門
Cross Platform Mobile Game Development
GraphQL
Game prototyping workshop
Hacking Art History
How to make Ajax Libraries work for you
Sylius, the good choice
Ruby on Rails - The Best Track for your Start Up
OPENVIS Conference Quick Report Part 2
[JS Kongress 2016] KittyCam.js - Raspberry Pi Camera w/ Cat Facial Detection
Metasepi team meeting #6: "Snatch-driven development"
Hunting The Shadows: In Depth Analysis of Escalated APT Attacks
 
Symfony & Javascript. Combining the best of two worlds
Esoteric, Obfuscated, Artistic Programming in Ruby
PDF.JS at SwissJeese 2012
Canvas Only: Creative Coding in HTML5

More from jeresig (20)

PDF
Does Coding Every Day Matter?
PDF
Accidentally Becoming a Digital Librarian
PDF
2014: John's Favorite Thing (Neo4j)
PDF
Computer Vision as Art Historical Investigation
PDF
Using JS to teach JS at Khan Academy
PDF
Applying Computer Vision to Art History
PDF
NYARC 2014: Frick/Zeri Results
PDF
Applying Computer Vision to Art History
PDF
JavaScript Libraries (Ajax Exp 2006)
PDF
Introduction to jQuery (Ajax Exp 2006)
PDF
jQuery Recommendations to the W3C (2011)
PDF
jQuery Open Source Process (RIT 2011)
PDF
jQuery Open Source Process (Knight Foundation 2011)
PDF
jQuery Mobile
PDF
jQuery Open Source (Fronteer 2011)
PDF
Holistic JavaScript Performance
PDF
New Features Coming in Browsers (RIT '09)
PDF
Introduction to jQuery (Ajax Exp 2007)
PDF
Advanced jQuery (Ajax Exp 2007)
PDF
JavaScript Library Overview (Ajax Exp West 2007)
Does Coding Every Day Matter?
Accidentally Becoming a Digital Librarian
2014: John's Favorite Thing (Neo4j)
Computer Vision as Art Historical Investigation
Using JS to teach JS at Khan Academy
Applying Computer Vision to Art History
NYARC 2014: Frick/Zeri Results
Applying Computer Vision to Art History
JavaScript Libraries (Ajax Exp 2006)
Introduction to jQuery (Ajax Exp 2006)
jQuery Recommendations to the W3C (2011)
jQuery Open Source Process (RIT 2011)
jQuery Open Source Process (Knight Foundation 2011)
jQuery Mobile
jQuery Open Source (Fronteer 2011)
Holistic JavaScript Performance
New Features Coming in Browsers (RIT '09)
Introduction to jQuery (Ajax Exp 2007)
Advanced jQuery (Ajax Exp 2007)
JavaScript Library Overview (Ajax Exp West 2007)

Recently uploaded (20)

PPTX
L1 - Introduction to python Backend.pptx
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PPTX
Odoo POS Development Services by CandidRoot Solutions
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PPTX
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
PDF
top salesforce developer skills in 2025.pdf
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PDF
Nekopoi APK 2025 free lastest update
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PDF
PTS Company Brochure 2025 (1).pdf.......
PPTX
Transform Your Business with a Software ERP System
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PPTX
Online Work Permit System for Fast Permit Processing
PDF
System and Network Administraation Chapter 3
PPTX
Introduction to Artificial Intelligence
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PPTX
ISO 45001 Occupational Health and Safety Management System
L1 - Introduction to python Backend.pptx
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
Odoo POS Development Services by CandidRoot Solutions
Navsoft: AI-Powered Business Solutions & Custom Software Development
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
top salesforce developer skills in 2025.pdf
VVF-Customer-Presentation2025-Ver1.9.pptx
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
Nekopoi APK 2025 free lastest update
Internet Downloader Manager (IDM) Crack 6.42 Build 41
Odoo Companies in India – Driving Business Transformation.pdf
PTS Company Brochure 2025 (1).pdf.......
Transform Your Business with a Software ERP System
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
Online Work Permit System for Fast Permit Processing
System and Network Administraation Chapter 3
Introduction to Artificial Intelligence
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
ISO 45001 Occupational Health and Safety Management System

EmpireJS: Hacking Art with Node js and Image Analysis