---
title: TarsosLSH in a Photomosaic Web App
canonical: https://0110.be/posts/TarsosLSH_in_a_Photomosaic_Web_App
markdown_url: https://0110.be/posts/TarsosLSH_in_a_Photomosaic_Web_App.md
id: 428
published_at: '2015-01-07T00:00:00Z'
updated_at: '2015-01-07T08:52:18Z'
author: Joren
tags:
- name: 0110.be
  markdown_url: https://0110.be/tags/0110.be.md
- name: Code
  markdown_url: https://0110.be/tags/Code.md
- name: HoGent
  markdown_url: https://0110.be/tags/HoGent.md
- name: Java
  markdown_url: https://0110.be/tags/Java.md
- name: UGent
  markdown_url: https://0110.be/tags/UGent.md
---

# TarsosLSH in a Photomosaic Web App

TarsosLSH is a Java library implementing Locality-sensitive Hashing (LSH), a practical nearest neighbor search algorithm for high dimensional vectors that operates in sublinear time. The open source software package is authored by me and is available on GitHub: [TarsosLSH on GitHub](https://github.com/JorenSix/TarsosLSH).

With TarsosLSH, Joseph Hwang and Nicholas Kwon from Rice University created an [Image Mosaic web application](http://image-mosaic.appspot.com/). The application chops an uploaded photo into small blocks. For each block, a color histogram is created and compared with an index of color histograms of reference images. Subsequently each block is replaced with one of the top three nearest neighbors, creating a mosaic. Since high dimensional nearest neighbor search is needed, this is an ideal application for TarsosLSH. The application somewhat proves that TarsosLSH can be used in practical applications, which is comforting.


![The Starry Night, by Van Ghogh in Mosaic as created by the mosaic webapplication.](https://0110.be/files/photos/428/StarryNights.png)

![The Starry Night, by Van Ghogh - Original](https://0110.be/files/photos/428/the-starry-night-1889_original.jpg)
