Code Monkey home page Code Monkey logo

music's Introduction

MuSIC: Multi-Spectral Images Compressor

Background

This is the Python source code of a project regarding the compression of hyperpectral images. In ordinary color images, every pixel usually holds three values, corresponding to the colors red, green and blue. Au contraire, hyperspectral images sample a scene in an extensive number of wavelengths. That is, every pixel in the image holds a k-dimensional vector, where each entry reflects the intensity of a certain wavelength, measured at that point. Therefore, the size of a hyperspectral image will be several times greater than the size of a greyscale or color image with the same spatial resolution.

Method

The Compressor can utilize both lossy and lossless compression methods:

For the lossless method, I chose to adapt the main principle of delta encoding to fit our case. In the code, I transformed the cube by replacing each slice with its difference from the previous slice. In other words, I treated each pixel in the hyperspectral cube as a sequence of its own and replaced it with its delta encoding.

For the lossy method, I chose to employ the Fourier transform. Compression algorithms like JPEG’s use image transforms to store only a subset of the image’s coefficients in the frequency domain. By that, they reduce the number of effective components in the image, increasing its compressibility. In my implementation, I applied the FFT over each slice of the cube separately, and then equated to zero its smallest coefficients.

After applying a method, the program uses zlib's implementation of the DEFLATE algorithm to enhance the compression. As can be seen below, by preprocessing our images using the above methods, we get higher compression ratio:

results.png

Usage

This program works with hyperspectral images in ENVI header format. By calling the help command, a menu will be printed, displaying the various compression options. Important note: the image's .raw and .hdr files must have the same name and be located in the same directory.

music's People

Contributors

gurelkin avatar

Watchers

 avatar

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.