Giter VIP home page Giter VIP logo

gabor's Introduction

FAQ

What is this?
An Angular web application written in TypeScript that demonstrates the effect of two-dimensional Gabor filters on images.

What is special about it?
Our web application uses WebAssembly to perform the mathematical calculations directly in the browser. This means that we are able to do high performance image analysis without a backend!

How can I try it?
The public demo page may be found at GitHub Pages: https://andreas-aeschlimann.github.io/gabor/

Introduction

Using the Fourier transform, one is able to determine frequencies that are present in the whole spatial domain. Unfortunately, it is not possible to say at which location the frequencies appear. In 1946, the Hungarian-born electrical engineer Dennis Gabor had the idea to modify the Fourier transform by adding a shifted window function g into the integral. From these modifications, the windowed Fourier transform—also known as the Gabor transform—was born.

Adjusting the equation of the Gabor transform, we may derive a different formulation that is a convolution of the original function and some other function. This other function is called Gabor filter (or function) and became well-known in image analysis. Interestingly, authors like John Daugman suggest that simple cells in the visual cortex of mammalian brains can be modeled by Gabor filters. As of today, Gabor filters have been used in image analysis, image compression, object recognition, medical diagnostics, and many more fields.

The author of this web page has studied the Gabor transform in the course of his master thesis at University of Basel. The thesis has been supervised by Prof. Dr. Helmut Harbrecht (Mathematical Institute) and Prof Dr. Lukas Rosenthaler (Digital Humanities). While the thesis is mainly focused on the theoretical part and the derivation of the Gabor transform and Gabor filters, this web application is meant to be a simple tool in order to apply the theory.

The thesis may be downloaded here: Gabor Transform and Vision.

Documentation

This repository contains implementations for Fourier and Gabor analysis. The project contains source code in different languages:

Web application (GUI)

The GUI of the web application has been built with Angular 6 and is written in TypeScript (JavaScript). We implemented the mathematical parts in native C code and used Emscripten to compile this code to WebAssembly. In order to make the whole application more reactive, we added Web Workers that are able to make the mathematical calculations in a background thread.

If you would like to try the web application on your computer, you have the following possibilities:

  • Navigate to our public GitHub Pages release: https://andreas-aeschlimann.github.io/gabor/.
  • Copy the contents of the folder docs/ to a webserver of your choice and open index.html in a browser.
  • For development: Clone this GIT repository and run the source code with Angular CLI (newest version of Node.js and NPMrequired). You may do that by running npm install followed by ng serve in your terminal or command line tool.

Please note: As of 2018, WebAssembly and Web Workers have only been available for one year. It is thus necessary to use new browser versions for the Gabor filter demo. Supported browsers are Google Chrome (including Android), Microsoft Edge, Mozilla Firefox, Opera and Apple Safari (including iOS). If you have problems, please make sure your browser is up-to-date.

C codes (Mathematics)

All mathematical calculations are done within the following C files:

  • main.c: Entry file for all function calls from JavaScript.
  • fourier.c: Provides methods related to the Fourier transform.
  • gabor.c: Provides methods related to the Gabor transform.

These C files are called from JavaScript methods that are in standalone files. This enables us to use these methods in Web Workers:

Matlab codes (Mathematics)

We have created two MATLAB classes that offer functionality for Fourier and Gabor analysis in one and two dimensions. They may be found on the repository under the following links:

  • Fourier.m: Contains methods related to the Fourier transform.
  • Gabor.m: Contains methods related to the Gabor transform and Gabor filters.

Please note: As of 2018, MATLAB offers many of these methods out of the box. Those are much faster than our own implementations. On the other hand, our classes are well-documented and may be considered for educational purposes.

About

This web application has been developed in 2018 by Andreas Aeschlimann, Mathematical Institute, University of Basel, Switzerland.

The source code may be freely used and is licensed under MIT.

Contact: [email protected]

gabor's People

Contributors

andreas-aeschlimann avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

nangolijude

gabor's Issues

Bug in Chrome

The main WebAssembly script that makes the calculations doesn't work anymore in Chrome 88 («Bad Magic Number»).

The error does not appear in Safari.

How to replicate filter result from web

Hi, nice work.

Your repository includes code both in MATLAB and C, I'm wondering which functions and how to call them to replicate the filter result on the cat.jpg image.

In C, is it using normalizedFilter2 or fgc2? When calling gaborConvolution2.js is f the convoluted image? If so, how can I read and split the cat image into y1 and yConvSum so that I can call fgc2?

For MATLAB, is it using the filter2 or normalizedFilter2 or fgc2 function? I guess my question is the same as above.

Thanks..!!

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.