Giter Site home page Giter Site logo

minhaskamal / skindetector Goto Github PK

View Code? Open in Web Editor NEW
28.0 4.0 7.0 19.85 MB

Detects Human Skin From Image (color-region-segmentation-photo-detection-extraction-detect)

Home Page: http://minhaskamal.github.io/SkinDetector

License: MIT License

Java 100.00%
region region-detection image-processing java segmentation egami skin image-segmentation template-matching

skindetector's Introduction

๐Ÿ’ƒ Skin Detector

Detects Human Skin From Image

This program is a very simple machine learning implementation for image region segmentation. Only by altering training data it can detect any type of region based on pixel value.

How to Run?

  1. For training the system run SkinDetectorTrainer.java. After training a knowledge file is created.
training
  1. Then run SkinDetectorTester.java or SkinDetectorTester2.java for getting output (change file-paths in the main method according to the need).

    input-

    input image

    output-

    outout image outout image

How It Works?

We have used naive Bayes here for classification (skin or non-skin pixel). As it is a colour image there are 256*256*256 types of pixels.

In the training phase, pixel frequencies of being skin or non-skin is calculated. We take every pixel of the image and see if it is a pixel of skin by using the mask. If the pixel is on skin, we increase its skin-frequency. Else we increase the non-skin-frequency. After processing all images, probability of a skin-pixels is calculated from the frequency using Bayes Theorem. We store this data in a file.

During testing, we simply map each pixel with the probability we calculated in training phase. If the probability is greater than a certain threshold, we mark that pixel as skin.

License

MIT License
SkinDetector is licensed under MIT License.

skindetector's People

Contributors

minhaskamal avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

skindetector's Issues

The caculteProbability funtion detect

the original implementation is :
probability = skinPixelNumber[i][j][k]*probabilityOfSkin/(skinPixelNumber[i][j][k]+nonskinPixelNumber[i][j][k]);

it should be conditional probaility;
probability = skinPixelNumber[i][j][k]/totalSkinPixelNumberprobabilityOfSkin/(skinPixelNumber[i][j][k]/totalSkinPixelNumberprobabilityOfSkin+nonskinPixelNumber[i][j][k]/totalNonskinPixelNumber*(1-probabilityOfSkin));

or

probability = skinPixelNumber[i][j][k]/(skinPixelNumber[i][j][k]+nonskinPixelNumber[i][j][k])

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.