Coder Social home page Coder Social logo

image-mapping-equations's Introduction

Title: Mapping Equations and Image Operations

Introduction: This Python script offers functionality for various image mapping equations and operations. Users can select between linear and non-linear mapping, perform digital negative, histogram stretch, and histogram shrink operations. The script allows users to specify input ranges for certain operations and provides visualizations of the results.

Usage:

  1. Running the Script:

    • Execute the script using Python interpreter:
      python3 code.py
      
  2. Functionality:

    • Upon execution, the user is presented with a menu to choose the desired operation.
    • Options include:
      • Linear Mapping
      • Non-linear Mapping
      • Digital Negative
      • Histogram Stretch
      • Histogram Shrink
      • Plot Histogram
      • Exit
    • Depending on the selected operation, the user may need to provide additional input such as range parameters.
    • Results are displayed using matplotlib.

Components:

  1. Linear Mapping:

    • Maps pixel values linearly based on user-defined range (a, b).
    • Formula: ( \frac{{\text{{image}} - a}}{{b - a}} )
  2. Non-linear Mapping:

    • Applies a non-linear transformation to the image using the formula: ( \log(1 + \text{{image}}) ).
  3. Digital Negative:

    • Inverts the pixel values, resulting in a negative image.
  4. Histogram Stretch:

    • Stretches the histogram of the image based on user-defined range (low, high).
    • Formula: ( \text{{clip}}\left(\frac{{\text{{image}} - \text{{low}}}}{{\text{{high}} - \text{{low}}}} \times 255.0, 0, 255\right) )
  5. Histogram Shrink:

    • Shrinks the histogram of the image based on user-defined range (low, high).
    • Formula: ( \text{{clip}}\left(\frac{{\text{{image}} - \text{{low}}}}{{\text{{high}} - \text{{low}}}} \times 255.0, 0, 255\right) )
  6. Plot Histogram:

    • Displays the histogram of the original image using matplotlib.

Conclusion: This Python script provides a user-friendly interface to perform various image mapping equations and operations. It offers flexibility in choosing input ranges and visualizing the results, making it suitable for educational and practical purposes in image processing.

image-mapping-equations's People

Contributors

usmanelahi00 avatar usmanelahi 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.