Coder Social home page Coder Social logo

droidadroit / variable-block-size-image-compression Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 2.0 1.28 MB

Compression of an image by using variable block-size for vector quantization.

Python 100.00%
vector-quantization edge-detection image-compression

variable-block-size-image-compression's Introduction

Variable block-size image compression based on edge detection

I exploited the redundancy or uniformity present in an image to compress it. This novel method estimates the detail present in a block using Canny's edge detector. Each block is classified into edge and nonedge using a criterion. By merging consecutive nonedge blocks, the block size is varied.

Getting Started

Prerequisites

  1. Anaconda for Python 2.7
  2. OpenCV for Python 2.7

Installing

  1. Anaconda for Python 2.7
    Go to the downloads page of Anaconda and select the installer for Python 2.7. Once downloaded, installing it should be a straightforward process. Anaconda has along with it most of the packages we need.

  2. OpenCV for Python 2.7
    This page explains it quite well.

Running

Before running vbs.py, there are a few parameters to be set.

image_location
bits_per_codevector
block_width
block_height
mu
threshold_1
threshold_2

image_location is set to the relative location of the image from the current directory.
bits_per_codevector is set based on the size of the codebook you desire. For e.g., for a 256-vector codebook, this value should be 8 as 2^8 = 256.
block_width and block_height are set to the size of the blocks the image is divided into. Make sure the blocks cover the the entire image.
mu is the coefficient used in the block-classifying criteria.
threshold_1 and threshold_2 are the parameters used by Canny edge detector.
perturbation_vector can be changed manually.

Once the parameters are set, enter the following command to run the script.
python [name of the script] [image_location] [bits_per_codevector] [block_width] [block_height] [mu] [threshold_1] [threshold_2]

Please go through the research paper for an understanding of the above terms.

variable-block-size-image-compression's People

Contributors

droidadroit avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

vvsmiler simrit1

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.