Giter Site home page Giter Site logo

ahsanraza05 / object-detection-java Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 2.0 32 MB

It is a Java based GUI desktop application which “detects the objects in a binary image using the concept of Neighborhood and connectivity”. More specifically it implements the concept of "M-Connectivity" of Digital Image Processing.

Java 100.00%
java neighborhood object-detection connectivity digital-image-processing image-procesing image-processing-programming

object-detection-java's Introduction

Object Detection java

Table of Contents

Overview

It is a Java based GUI desktop application which “detects the objects in a binary image using the concept of Neighborhood and connectivity”. More specifically it implements the concept of "M-Connectivity" of Digital Image Processing.

How to Install and Run the Project

Method # 1: Download 'Executable (exe)' file from 'PORTABLE APPLICATION' Folder (Easy & Portable)

            No need to install anything but it is for WINDOWS OS  

Method # 2: Download and Load Project in Eclipse IDE to Run it

            Eclipse IDE & JVM will be required.

File Contents

  • src/Application/ObjectDetection.java includes the implementation of neighbourhood & connectivity concept (main logic).
  • src/com/test/jfilepicker package includes source files for GUI components.
  • src/com/test/jfilepicker package/images package includes the binary images.

Introduction

1-Neighborhood

A Digital Image comprises of a 2D matrix, and every element is called as Pixel. The Image is denoted by f(x,y) and any pixel can be denoted by small letter, say p, q … Every Pixel has some Neighbors located around it.

Different types of neighbors include: 4 Neighbors D Neighbors 8 Neighbors

4-Neighbors

A pixel ’p’ located at coordinate value (x,y) has 4 neighbors, which are adjacent to ‘p’. The coordinate values can be determined as: (x+1,y) (x-1,y) (x,y+1) (x,y-1) by N4(p) 4 Neighbors are denoted

Image of 4-Neighbors

4-Neighbors

(ii) D-Neighbors

A pixel ’p’ located at coordinate value (x,y) has D neighbors, which are located in Diagonal of ‘p’. The coordinate values can be determined as: (x+1,y+1) (x+1,y-1) (x-1,y+1) (x-1,y-1) 8 Neighbors are denoted by N8(p)

Image of D-Neighbors

D-Neighbors

(ii) 8-Neighbors

A pixel ’p’ located at coordinate value (x,y) has 8 neighbors, which are combination of 4 and D Neighbors. 8 Neighbors are denoted by N8(p)

(x+1,y) (x-1,y) (x,y+1) (x,y-1) (x+1,y+1) (x+1,y-1) (x-1,y+1) (x-1,y-1)

Image of 8-Neighbors

8-Neighbors

Connectivity

Connectivity between pixels is an important concept used in establishing boundaries of objects and components of regions in an image.

As we can identify different objects in Image depending upon the Intensity values of Pixels.

So all Pixels comprising an object would have Same or Close values.

To establish whether two pixels are connected, it must be determined

If they are adjacent in some sense (say, if they are 4-neighbors) . and If their grey levels satisfy a specified criterion of similarity.

The specified Criteria (Intensity Range ) can be defined by defining a set ‘V’ at start. For V={2} Only those Pixel can be connected which have value =2 For V={1,2} Only those Pixel can be connected which have value =1 or 2. The specified Criteria (Intensity Range ) can be defined by defining a set ‘V’ at start.

(i) 4-Connectivity:

Image of 4-Connectivity

4-Connectivity

Two pixels p and q with values from V are 4- connected if q is in the set N4 (p).

(ii) 8-Connectivity:

Image of 8-Connectivity

8-Connectivity

Two pixels p and q with values from V are 8- connected if q is in the set N8 (p).

(ii) M-Connectivity:

Two pixels p and q with values from V are m-connected if: q is in N4 (p), OR q is in ND (p) AND the set N4 (p) ∩ N4 (p) is empty.

Image of M-Connectivity

M-Connectivity

Input images of objects

Black Colored Objects (Fruits)

Fig-I: Black Colored Objects (Fruits)

White Colored Objects (Fruits)

Fig-II: White Colored Objects (Fruits)

White Colored Objects (Un Post Processed Coins)

Fig-III: White Colored Objects (Un-Post Processed Coins)

White Colored Objects (Post Processed Coins)

Fig-IV: White Colored Objects (Post Processed Coins)

Program Screenshots

1st Window

Fig-A: Browsing image

2nd Window

Fig-B: Selecting an image (See Fig-I)

3rd Window

Fig-C: Specifying color of object

4th Window

Fig-D: Result

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.