Giter Site home page Giter Site logo

image-processing's Introduction

Image-Processing

Gaussian Blur

  • Gaussian blur known as Gaussian smoothing is the result of blurring an image by a gaussian function. It is typically used for reducing image noise and reducing detail.

  • Mathematically, applying a Gaussian blur to an image is the same as convolving the image with Gaussian function.

  • Since the Fourier transform of a Gaussian is another Gaussian, applying a Guassian blur has the effect of reducing the image’s high-frequency components; at same time, a Gaussian blur is thus a low pass filter.

  • A box blur (also known as a box linear filter) is a spatial domain linear filter in which each pixel in the resulting image has a value equal to the average value of its neighboring pixels in the input image. It is a form of low-pass ("blurring") filter. A 3 by 3 box blur can be written as 1/9 * determinant matrix:

Example with 3x3 convolution kernel

Prewitt

  • The Prewitt operator is used in image processing, particularly within edge detection algorithms

  • Technically, it is a discrete differentiation operator, computing an approximation of the gradient of the image intensity function.

  • At each point in the image, the result of the Prewitt operator is either the corresponding gradient vector or the norm of this vector. The Prewitt operator is based on convolving the image with a small, separable, and integer valued filter in horizontal and vertical directions and is therefore relatively inexpensive in terms of computations like Sobel and Kayyali operators. On the other hand, the gradient approximation which it produces is relatively crude, in particular for high frequency variations in the image.

  • Mathematically, the operator uses two 3×3 kernels which are convolved with the original image to calculate approximations of the derivatives - one for horizontal changes, and one for vertical. If we define A as the source image, and Gx and Gy. are two images which at each point contain the horizontal and vertical derivative approximations, the latter are computed as:

  • The x-coordinate is defined here as increasing in the "right"-direction, and the y-coordinate is defined as increasing in the "down"-direction. At each point in the image, the resulting gradient approximations can be combined to give the gradient magnitude, using:

  • Use this equation shown below, we can calcuate the gradient's direction:

Example with original image

Example with image after Gaussian Blur

Conclusion:

The image noise will affect the performace of edge detection, so add guassian blur to filter the images are necessary for getting good performance.

Canny

SIFT(Scale Invariant Feature Transform)

Pipeline

1. Constructing a scale Space

To make sure that features are scale-independent

Scale space is a collection of images having different scales, generated from a signle image.

Difference of Gaussian is a feature enhancement algorithm that involves the subtraction of one blurred version of an original image from another, less blurred version of the original

Here is a visual explanation how DOG works

2. Keypoint Localisation

Identifyling the suitable features or keypoints

Local Max and local Min

To locate the local Max and Min, we go through every pixel in the image and compare it with its neighboring pixels

Keypoint Selection

Eliminate the keypoints that have low contrast, or lie very close to the edge

3. Orientation Assignment

Ensure the keypoints are rotation invariant

Calculate Magnitude and Orientation

The magnitude represents the intensity of the pixel and the orientation gives the direction for the same

4. Keypoint Descriptor

Assign a unique figerprint of each keypoint

Keypoint Descriptor

We will first take a 16×16 neighborhood around the keypoint. This 16×16 block is further divided into 4×4 sub-blocks and for each of these sub-blocks, we generate the histogram using magnitude and orientation.

Here is my results using my images

Feature Matching

End Note

SIFT is a very useful method to explore the same objects in two pictures. When thers is more than 80% points match, we can say two images have same objects.

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.