Coder Social home page Coder Social logo

sakshikakde / probability-based-edge-detection Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 1.0 11.65 MB

Python implementation of a probability based boundary detection algorithm.

Python 100.00%
edge-detection computer-vision derivative-of-gaussian gabor-filters leung-malik texton-maps brightness-map half-disk-masks python3

probability-based-edge-detection's Introduction

Probability based edge detection

Phase 1

My homework 0 submission for the course CMSC733 Computer Processing of Pictorial Information. In this repository, a simple of version of PB boundary detection algorithm has been implemented. The classical approaches like Canny and Sobel edge detectors measures discontinuities in the image intensities to detect edges. The PB algorithm considers texture and color information along with intensity, making it a better performing algorithm.

Sample input image

Filter banks

Filter banks are a set of filters, that are applied over an image to extract multiple features. In this homework, filter banks have been used to extract the texture properties. The following subsections will describe in brief the implementation of DoG filters, Leung-Malik filters and Gabor filters.

Oriented Derivative of Gaussian Filters

Leung-Malik Filters: LM large and LM small

Gabor Filters

Texton Maps

The filters described in the previous section are to detect the texture properties in an image. Since each filter bank has multiple filters and three such filter banks have been used, the result is a vector of filter responses. This vector of filter response associated with each pixel is encoding a texture property. Based on this filter response vectors, pixels with similar texture property were clustered together using K-mean algorithm(K= 64). The output of K-mean clustering is a Texton map(τ )

Brightness Maps

The image was clustered based on the brightness value for each pixel. The images were first converted to gray scale and K-mean algorithm(K=16) was used to get brightness maps.

Color Maps

The image consists of three color channals(RGB), describ- ing the color property at each pixel. The images have been clustered using the RGB value using K-mean algorithm(K=16) to obtain color maps.

Texture, Brightness and Color Gradients

To obtain Tg,Bg,Cg, we need to compute differences of values across different shapes and sizes. This can be achieved very efficiently by the use of Half-disc masks.

Half disk masks

Texture Gradient

Brightness Gradient

Color Gradient

Sobel and Canny baseline

The outputs from Sobel and Canny edge detector are combined using weighted average method.

Sobel baseline

Canny baseline

Pb-lite output

In the final step, the features from baseline methods(Canny and Sobel operator) were combined with the gradients of τ , β, ζ.

Running the code

File structure

.
├── Code
|  ├── Wrapper.py
├── Data
|  ├── BSDS500
├── Results
|  ├── Filters
|  ├── Testron_map
|  ├── Brightness_map
|  ├── Color_map
|  ├── T_g
|  ├── B_g
|  ├── C_g
|  ├── pb_lite_output

How to run the code

  • Change the location to
    {root_directory}/Phase1

  • Run the following command
    python3 Code/Wrapper.py

Phase 2

In this section, a basic neural network and its modified version for classification on CIFAR10 dataset have been de- scribed. Later, a case study for ResNet, ResNext and DenseNet architecture was conducted. Refer report for more details.

probability-based-edge-detection's People

Contributors

sakshikakde avatar

Watchers

 avatar

Forkers

dmwu1115

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.