Code Monkey home page Code Monkey logo

inner-boundary-tracing's Introduction

Computer vision algorithms

1. boundary tracing algorithm:

The border tracing algorithm is used to extract the contours of the objects (regions) from an image. When applying this algorithm it is assumed that the image with regions is either binary or those regions have been previously labeled.

Algorithm's steps:

1. Search the image from top left until a pixel of a new region is found; this pixel Po

is the starting pixel of the region border. Define a variable dir which stores the direction of the previous move along the border from the previous border element to the current border element.

Assign :

(a) dir = 0 if the border is detected in 4-connectivity

(b) dir = 7 if the border is detected in 8-connectivity

2. Search the 3x3 neighborhood of the current pixel in an anti-clockwise direction,

beginning the neighborhood search at the pixel positioned in the direction

(a) (dir + 3) mod 4

(b) (dir + 7) mod 8 if dir is even or (dir + 6) mod 8 if dir is odd

The first pixel found with the same value as the current pixel is a new boundary element Pn. Update the dir value.

3. If the current boundary element Pn is equal to the second border element P1 and if

the previous border element Pn-1 is equal to Po, stop. Otherwise repeat step (2).

4. The detected border is represented by pixels Po ... Pn-2.

5. after detecting the first object, it's removed from the original image , then the algorithm starts again with the image after removing the object , and detects the boundary for the next object , then we delete it from the original image , and so on so forth.

5.1 Uploading an existing image using BoundaryTracing_2.py

image

# Installing Dependencies
pip install numpy as np
pip install opencv-python

# clone the rebo

# Running the application 
python3 boundaryTracing.py

2. Hough transform :

The circle Hough Transform (CHT) is a basic feature extraction technique used in digital image processing for detecting circles in imperfect images. The circle candidates are produced by “voting” in the Hough parameter space and then selecting local maxima in an accumulator matrix.

inner-boundary-tracing's People

Contributors

abdelrahmankk avatar mostafa-medhat avatar mohab-hisham avatar mohamedmansour20 avatar

Stargazers

Mostafa Wael 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.