Skip to content

szymonrucinski/image-processing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The Image Processing

Classic image-processing algorithms, written in C++ in 2019, running in your browser.

▶  Open the live museum

C / C++  ·  CImg  ·  Emscripten  ·  WebAssembly  ·  vanilla JS


Pick a public-domain photograph and run classic image-processing algorithms on it: brightness and contrast, median and harmonic filters, edge and line detection, histogram equalisation, morphology, and the Fourier domain. The result appears straight away. The algorithms are the original C++ I wrote in 2019 for the Computer Vision course of my Information Technology bachelor's degree, compiled to WebAssembly and run unchanged. No image is uploaded; everything happens on your machine.

The developing room

Examples

Every result below is produced by the actual compiled C++, applied to Ansel Adams's The Tetons and the Snake River (1942).


Original
the source photograph

Negative
invert every pixel, g = 255 − f

Roberts edges
2×2 diagonal gradient (1963)

Rayleigh equalise
redistribute tones to reveal detail

Median filter
denoise, keep edges sharp

FFT spectrum
log-magnitude Fourier transform

How it works

Each operation is the original C++ program, compiled to WebAssembly and run unchanged, driven exactly as it would be from a terminal:

canvas pixels  ->  encode 24-bit BMP  ->  write /input.bmp into Emscripten's in-memory filesystem
               ->  Module.callMain(['--orobertsi', '/input.bmp'])   (the program's real main)
               ->  read /newOne.bmp  ->  decode BMP  ->  draw to canvas

-Dcimg_display=0 turns CImg's desktop-window calls into no-ops, so the original GUI code runs harmlessly and image.save() still writes the result. The algorithm source is byte-for-byte unchanged. See WEB-MUSEUM.md for the details and the full list of operations.

Repository

Path What
Task1Task4/ the original C++/CImg programs (unchanged algorithm source)
docs/ the website (HTML/CSS/JS and the compiled wasm/), served by GitHub Pages
build/build.sh compiles the four programs to WebAssembly
WEB-MUSEUM.md what changed for the browser port, exhibited vs. omitted operations

Build the WebAssembly

source ~/emsdk/emsdk_env.sh      # Emscripten SDK
bash build/build.sh              # writes docs/wasm/Task{1..4}.{js,wasm}

Credits

Algorithms by Szymon Ruciński (2019). The gallery is public-domain photography from NASA, the Farm Security Administration / Office of War Information, the U.S. National Archives (Ansel Adams's National Park Service series), and the 1873 Wheeler Survey, sourced via the Library of Congress, the National Archives and Wikimedia Commons.

About

Classic image-processing algorithms written in C++ (CImg) for a 2019 computer vision course, compiled to WebAssembly and run unchanged in the browser on public-domain photographs.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages