Commit cbd86a32 authored by WillBrennan's avatar WillBrennan Committed by GitHub

Merge pull request #6 from WillBrennan/develop

Develop
parents b8f533e0 ec3ca3c7
language: python
before_script:
- pip install -U pytest
matrix:
include:
- python: "2.6"
- python: "2.7"
- python: "3.2"
- python: "3.3"
- python: "3.4"
- python: "3.5"
- python: "3.5-dev"
- python: "3.6"
- python: "3.6-dev"
- python: "3.7"
- python: "nightly"
allow_failures:
- python: "3.2"
- python: "3.5-dev"
- python: "3.6"
- python: "3.6-dev"
- python: "3.7"
- python: "nightly"
install: "pip install -r requirements.txt"
script:
- uname -a
- pytest --version
- pytest
\ No newline at end of file
...@@ -3,15 +3,13 @@ ...@@ -3,15 +3,13 @@
__author__ = 'Will Brennan' __author__ = 'Will Brennan'
# Built-in Modules # Built-in Modules
import os
import argparse import argparse
import logging import logging
# Standard Modules import os
import cv2 import cv2
import numpy
# Custom Modules from SkinDetector import SkinDetector, scripts
import scripts
from SkinDetector import SkinDetector
logger = logging.getLogger('main') logger = logging.getLogger('main')
......
# SkinDetector # SkinDetector
This is a high-speed python based skin detection system using OpenCV, it is done using adaptive thresholding, reference papers can be found below. It is designed for processing VGA sized images in real time for the [Gesture Control](https://github.com/WillBrennan/GestureControl) project. This is a high-speed python based skin detection system using OpenCV, it is done using adaptive thresholding, reference
papers can be found below. It is designed for processing VGA sized images in real time for Gesture Control.
## Quick Start ## Quick Start
Getting the app to run is pretty easy. This script will not [install OpenCV](http://docs.opencv.org/doc/tutorials/introduction/linux_install/linux_install.html). However to install the rest of the project dependencies and run the demo script use the following commands. Getting the app to run is pretty easy. This script will not [install OpenCV](http://docs.opencv.org/doc/tutorials/introduction/linux_install/linux_install.html).
However to install the rest of the project dependencies and run the demo script use the following commands;
```bash ```bash
# Clone the repo # Clone the repo
...@@ -11,20 +13,15 @@ git clone https://github.com/WillBrennan/SkinDetector && cd SkinDetector ...@@ -11,20 +13,15 @@ git clone https://github.com/WillBrennan/SkinDetector && cd SkinDetector
# Install requirements # Install requirements
python setup.py install python setup.py install
# Run the bot # Run the bot
python main.py <directory of images> --display python FromFile.py <directory of images> --display
``` ```
## Usage ## Usage
Usage of this as a submodule is simple, just clone into your projects directory (or preferably add as a git submodule), and your ready to go. Below
is an example code usage.
```python ```python
import os
import cv2 import cv2
import numpy
import SkinDetector import SkinDetector
img_path = raw_input("Please Enter Image Path") img_path = raw_input("Please Enter Image Path")
assert os.path.exists(img_path), "img_path does not exsist"
image = cv2.imread(img_path) image = cv2.imread(img_path)
mask = SkinDetector.process(image) mask = SkinDetector.process(image)
cv2.imshow("input", image) cv2.imshow("input", image)
...@@ -32,10 +29,8 @@ cv2.imshow("mask", mask) ...@@ -32,10 +29,8 @@ cv2.imshow("mask", mask)
cv2.waitKey(0) cv2.waitKey(0)
``` ```
## References
[Skin Segementation Using Multiple Thresholds](http://www.ivl.disco.unimib.it/papers2003/EI06-EI109%20Skin-paper.pdf)
## Demonstration ## Demonstration
![Demo on Astronaught](https://raw.githubusercontent.com/WillBrennan/SkinDetector/master/demo.png "Demonstration") ![Demo on Astronaut](https://raw.githubusercontent.com/WillBrennan/SkinDetector/master/docs/assets/demo.png "Demonstration")
## Based Upon
[Skin Segmentation Using Multiple Thresholds](http://www.ivl.disco.unimib.it/papers2003/EI06-EI109%20Skin-paper.pdf)
...@@ -3,13 +3,12 @@ ...@@ -3,13 +3,12 @@
__author__ = 'Will Brennan' __author__ = 'Will Brennan'
# Built-in Modules # Built-in Modules
import time
import argparse
import logging import logging
# Standard Modules import time
import cv2 import cv2
import numpy import numpy
# Custom Modules
import scripts import scripts
logger = logging.getLogger('main') logger = logging.getLogger('main')
......
...@@ -3,5 +3,6 @@ ...@@ -3,5 +3,6 @@
__author__ = 'willbrennan' __author__ = 'willbrennan'
from SkinDetector import SkinDetector from SkinDetector import SkinDetector
from scripts import display
__all__ = ["SkinDetector"] __all__ = ["SkinDetector", "display"]
\ No newline at end of file \ No newline at end of file
...@@ -5,11 +5,10 @@ __author__ = 'Will Brennan' ...@@ -5,11 +5,10 @@ __author__ = 'Will Brennan'
# Built-in Modules # Built-in Modules
import argparse import argparse
import logging import logging
# Standard Modules
import cv2 import cv2
# Custom Modules
import scripts from SkinDetector import SkinDetector, scripts
from SkinDetector import SkinDetector
if __name__ == '__main__': if __name__ == '__main__':
parser = argparse.ArgumentParser(description=__doc__) parser = argparse.ArgumentParser(description=__doc__)
......
#!/usr/bin/env python #!/usr/bin/env python
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
__author__ = 'Will Brennan'
# Built-in Modules
# Standard Modules
# Custom Modules
"""
Will automatically ensure that all build prerequisites are available
via ez_setup.
Usage:
python setup.py install
"""
import ez_setup import ez_setup
ez_setup.use_setuptools() ez_setup.use_setuptools()
...@@ -24,3 +13,30 @@ setup( ...@@ -24,3 +13,30 @@ setup(
author_email='william.brennan@skytales.com', author_email='william.brennan@skytales.com',
license='GPL', license='GPL',
install_requires=["numpy"], ) install_requires=["numpy"], )
from setuptools import setup, find_packages
with open('README.rst') as f:
readme = f.read()
with open('LICENSE') as f:
license = f.read()
with open('requirements.txt') as f:
required = f.read().splitlines()
setup(
name='Skin Detector',
version='prototype',
description='A speedy skin-detector based upon colour thresholding',
long_description=readme,
author='WillBrennan',
author_email='WillBrennan@users.noreply.github.com',
url='https://github.com/WillBrennan/SkinDetector',
license=license,
install_requires=required,
packages=find_packages(exclude=('tests', 'docs'))
)
import unittest
class BasicTestSuite(unittest.TestCase):
def test_dummy(self):
assert True
if __name__ == '__main__':
unittest.main()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment