├── .vscode └── launch.json ├── Image ├── HGR1 │ ├── 0 │ │ ├── 1_HSV.jpg │ │ ├── 2_YCbCr.jpg │ │ ├── 3_global_result.jpg │ │ └── T_P_hgr1_id04_8.jpg │ ├── 1 │ │ ├── 1_HSV.jpg │ │ ├── 2_YCbCr.jpg │ │ ├── 3_global_result.jpg │ │ └── A_P_hgr1_id01_1.jpg │ ├── 2 │ │ ├── 1_HSV.jpg │ │ ├── 2_YCbCr.jpg │ │ ├── 3_global_result.jpg │ │ └── O_P_hgr1_id03_9.jpg │ ├── 3 │ │ ├── 1_HSV.jpg │ │ ├── 2_YCbCr.jpg │ │ ├── 3_global_result.jpg │ │ └── E_P_hgr1_id03_6.jpg │ ├── 4 │ │ ├── 1_HSV.jpg │ │ ├── 2_YCbCr.jpg │ │ ├── 3_global_result.jpg │ │ └── K_P_hgr1_id03_6.jpg │ └── 5 │ │ ├── 1_HSV.jpg │ │ ├── 2_YCbCr.jpg │ │ ├── 3_global_result.jpg │ │ └── K_P_hgr1_id08_2.jpg ├── HGR2a │ ├── 0 │ │ ├── 1_HSV.jpg │ │ ├── 2_YCbCr.jpg │ │ ├── 3_global_result.jpg │ │ └── B_S_hgr2A1_id03_1.jpg │ └── 1 │ │ ├── 1_HSV.jpg │ │ ├── 2_YCbCr.jpg │ │ ├── 3_global_result.jpg │ │ └── B_P_hgr2A2_id01_2.jpg ├── ReadMeImages │ ├── ROC_HGR.png │ ├── ROC_SFA.png │ ├── all_detection.png │ ├── result1.png │ ├── result2.png │ └── result3.png └── SFA │ ├── 0 │ ├── 1_HSV.jpg │ ├── 2_YCbCr.jpg │ ├── 3_global_result.jpg │ └── img (937).jpg │ ├── 1 │ ├── 1_HSV.jpg │ ├── 2_YCbCr.jpg │ ├── 3_global_result.jpg │ └── img (589).jpg │ ├── 2 │ ├── 1_HSV.jpg │ ├── 2_YCbCr.jpg │ ├── 3_global_result.jpg │ └── img (671).jpg │ ├── 3 │ ├── 1_HSV.jpg │ ├── 2_YCbCr.jpg │ ├── 3_global_result.jpg │ └── img (709).jpg │ ├── 4 │ ├── 1_HSV.jpg │ ├── 20.jpg │ ├── 2_YCbCr.jpg │ └── 3_global_result.jpg │ ├── 5 │ ├── 1_HSV.jpg │ ├── 2_YCbCr.jpg │ ├── 3_global_result.jpg │ └── img (769).jpg │ └── 6 │ ├── 1_HSV.jpg │ ├── 27.jpg │ ├── 2_YCbCr.jpg │ └── 3_global_result.jpg ├── README.md └── SkinDetection.py /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | 8 | { 9 | "name": "Python: Current File (Integrated Terminal)", 10 | "type": "python", 11 | "request": "launch", 12 | "program": "${file}", 13 | "console": "integratedTerminal" 14 | }, 15 | { 16 | "name": "Python: Attach", 17 | "type": "python", 18 | "request": "attach", 19 | "port": 5678, 20 | "host": "localhost" 21 | }, 22 | { 23 | "name": "Python: Module", 24 | "type": "python", 25 | "request": "launch", 26 | "module": "enter-your-module-name-here", 27 | "console": "integratedTerminal" 28 | }, 29 | { 30 | "name": "Python: Django", 31 | "type": "python", 32 | "request": "launch", 33 | "program": "${workspaceFolder}/manage.py", 34 | "console": "integratedTerminal", 35 | "args": [ 36 | "runserver", 37 | "--noreload", 38 | "--nothreading" 39 | ], 40 | "django": true 41 | }, 42 | { 43 | "name": "Python: Flask", 44 | "type": "python", 45 | "request": "launch", 46 | "module": "flask", 47 | "env": { 48 | "FLASK_APP": "app.py" 49 | }, 50 | "args": [ 51 | "run", 52 | "--no-debugger", 53 | "--no-reload" 54 | ], 55 | "jinja": true 56 | }, 57 | { 58 | "name": "Python: Current File (External Terminal)", 59 | "type": "python", 60 | "request": "launch", 61 | "program": "${file}", 62 | "console": "externalTerminal" 63 | } 64 | ] 65 | } -------------------------------------------------------------------------------- /Image/HGR1/0/1_HSV.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CHEREF-Mehdi/SkinDetection/ffbc1ebbc630e51b2d54542daf5807fe198ba639/Image/HGR1/0/1_HSV.jpg -------------------------------------------------------------------------------- /Image/HGR1/0/2_YCbCr.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CHEREF-Mehdi/SkinDetection/ffbc1ebbc630e51b2d54542daf5807fe198ba639/Image/HGR1/0/2_YCbCr.jpg -------------------------------------------------------------------------------- /Image/HGR1/0/3_global_result.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CHEREF-Mehdi/SkinDetection/ffbc1ebbc630e51b2d54542daf5807fe198ba639/Image/HGR1/0/3_global_result.jpg -------------------------------------------------------------------------------- /Image/HGR1/0/T_P_hgr1_id04_8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CHEREF-Mehdi/SkinDetection/ffbc1ebbc630e51b2d54542daf5807fe198ba639/Image/HGR1/0/T_P_hgr1_id04_8.jpg -------------------------------------------------------------------------------- /Image/HGR1/1/1_HSV.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CHEREF-Mehdi/SkinDetection/ffbc1ebbc630e51b2d54542daf5807fe198ba639/Image/HGR1/1/1_HSV.jpg -------------------------------------------------------------------------------- /Image/HGR1/1/2_YCbCr.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CHEREF-Mehdi/SkinDetection/ffbc1ebbc630e51b2d54542daf5807fe198ba639/Image/HGR1/1/2_YCbCr.jpg -------------------------------------------------------------------------------- /Image/HGR1/1/3_global_result.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CHEREF-Mehdi/SkinDetection/ffbc1ebbc630e51b2d54542daf5807fe198ba639/Image/HGR1/1/3_global_result.jpg -------------------------------------------------------------------------------- /Image/HGR1/1/A_P_hgr1_id01_1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CHEREF-Mehdi/SkinDetection/ffbc1ebbc630e51b2d54542daf5807fe198ba639/Image/HGR1/1/A_P_hgr1_id01_1.jpg -------------------------------------------------------------------------------- /Image/HGR1/2/1_HSV.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CHEREF-Mehdi/SkinDetection/ffbc1ebbc630e51b2d54542daf5807fe198ba639/Image/HGR1/2/1_HSV.jpg -------------------------------------------------------------------------------- /Image/HGR1/2/2_YCbCr.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CHEREF-Mehdi/SkinDetection/ffbc1ebbc630e51b2d54542daf5807fe198ba639/Image/HGR1/2/2_YCbCr.jpg -------------------------------------------------------------------------------- /Image/HGR1/2/3_global_result.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CHEREF-Mehdi/SkinDetection/ffbc1ebbc630e51b2d54542daf5807fe198ba639/Image/HGR1/2/3_global_result.jpg -------------------------------------------------------------------------------- /Image/HGR1/2/O_P_hgr1_id03_9.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CHEREF-Mehdi/SkinDetection/ffbc1ebbc630e51b2d54542daf5807fe198ba639/Image/HGR1/2/O_P_hgr1_id03_9.jpg -------------------------------------------------------------------------------- /Image/HGR1/3/1_HSV.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CHEREF-Mehdi/SkinDetection/ffbc1ebbc630e51b2d54542daf5807fe198ba639/Image/HGR1/3/1_HSV.jpg -------------------------------------------------------------------------------- /Image/HGR1/3/2_YCbCr.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CHEREF-Mehdi/SkinDetection/ffbc1ebbc630e51b2d54542daf5807fe198ba639/Image/HGR1/3/2_YCbCr.jpg -------------------------------------------------------------------------------- /Image/HGR1/3/3_global_result.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CHEREF-Mehdi/SkinDetection/ffbc1ebbc630e51b2d54542daf5807fe198ba639/Image/HGR1/3/3_global_result.jpg -------------------------------------------------------------------------------- /Image/HGR1/3/E_P_hgr1_id03_6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CHEREF-Mehdi/SkinDetection/ffbc1ebbc630e51b2d54542daf5807fe198ba639/Image/HGR1/3/E_P_hgr1_id03_6.jpg -------------------------------------------------------------------------------- /Image/HGR1/4/1_HSV.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CHEREF-Mehdi/SkinDetection/ffbc1ebbc630e51b2d54542daf5807fe198ba639/Image/HGR1/4/1_HSV.jpg -------------------------------------------------------------------------------- /Image/HGR1/4/2_YCbCr.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CHEREF-Mehdi/SkinDetection/ffbc1ebbc630e51b2d54542daf5807fe198ba639/Image/HGR1/4/2_YCbCr.jpg -------------------------------------------------------------------------------- /Image/HGR1/4/3_global_result.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CHEREF-Mehdi/SkinDetection/ffbc1ebbc630e51b2d54542daf5807fe198ba639/Image/HGR1/4/3_global_result.jpg -------------------------------------------------------------------------------- /Image/HGR1/4/K_P_hgr1_id03_6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CHEREF-Mehdi/SkinDetection/ffbc1ebbc630e51b2d54542daf5807fe198ba639/Image/HGR1/4/K_P_hgr1_id03_6.jpg -------------------------------------------------------------------------------- /Image/HGR1/5/1_HSV.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CHEREF-Mehdi/SkinDetection/ffbc1ebbc630e51b2d54542daf5807fe198ba639/Image/HGR1/5/1_HSV.jpg -------------------------------------------------------------------------------- /Image/HGR1/5/2_YCbCr.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CHEREF-Mehdi/SkinDetection/ffbc1ebbc630e51b2d54542daf5807fe198ba639/Image/HGR1/5/2_YCbCr.jpg -------------------------------------------------------------------------------- /Image/HGR1/5/3_global_result.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CHEREF-Mehdi/SkinDetection/ffbc1ebbc630e51b2d54542daf5807fe198ba639/Image/HGR1/5/3_global_result.jpg -------------------------------------------------------------------------------- /Image/HGR1/5/K_P_hgr1_id08_2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CHEREF-Mehdi/SkinDetection/ffbc1ebbc630e51b2d54542daf5807fe198ba639/Image/HGR1/5/K_P_hgr1_id08_2.jpg -------------------------------------------------------------------------------- /Image/HGR2a/0/1_HSV.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CHEREF-Mehdi/SkinDetection/ffbc1ebbc630e51b2d54542daf5807fe198ba639/Image/HGR2a/0/1_HSV.jpg -------------------------------------------------------------------------------- /Image/HGR2a/0/2_YCbCr.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CHEREF-Mehdi/SkinDetection/ffbc1ebbc630e51b2d54542daf5807fe198ba639/Image/HGR2a/0/2_YCbCr.jpg -------------------------------------------------------------------------------- /Image/HGR2a/0/3_global_result.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CHEREF-Mehdi/SkinDetection/ffbc1ebbc630e51b2d54542daf5807fe198ba639/Image/HGR2a/0/3_global_result.jpg -------------------------------------------------------------------------------- /Image/HGR2a/0/B_S_hgr2A1_id03_1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CHEREF-Mehdi/SkinDetection/ffbc1ebbc630e51b2d54542daf5807fe198ba639/Image/HGR2a/0/B_S_hgr2A1_id03_1.jpg -------------------------------------------------------------------------------- /Image/HGR2a/1/1_HSV.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CHEREF-Mehdi/SkinDetection/ffbc1ebbc630e51b2d54542daf5807fe198ba639/Image/HGR2a/1/1_HSV.jpg -------------------------------------------------------------------------------- /Image/HGR2a/1/2_YCbCr.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CHEREF-Mehdi/SkinDetection/ffbc1ebbc630e51b2d54542daf5807fe198ba639/Image/HGR2a/1/2_YCbCr.jpg -------------------------------------------------------------------------------- /Image/HGR2a/1/3_global_result.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CHEREF-Mehdi/SkinDetection/ffbc1ebbc630e51b2d54542daf5807fe198ba639/Image/HGR2a/1/3_global_result.jpg -------------------------------------------------------------------------------- /Image/HGR2a/1/B_P_hgr2A2_id01_2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CHEREF-Mehdi/SkinDetection/ffbc1ebbc630e51b2d54542daf5807fe198ba639/Image/HGR2a/1/B_P_hgr2A2_id01_2.jpg -------------------------------------------------------------------------------- /Image/ReadMeImages/ROC_HGR.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CHEREF-Mehdi/SkinDetection/ffbc1ebbc630e51b2d54542daf5807fe198ba639/Image/ReadMeImages/ROC_HGR.png -------------------------------------------------------------------------------- /Image/ReadMeImages/ROC_SFA.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CHEREF-Mehdi/SkinDetection/ffbc1ebbc630e51b2d54542daf5807fe198ba639/Image/ReadMeImages/ROC_SFA.png -------------------------------------------------------------------------------- /Image/ReadMeImages/all_detection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CHEREF-Mehdi/SkinDetection/ffbc1ebbc630e51b2d54542daf5807fe198ba639/Image/ReadMeImages/all_detection.png -------------------------------------------------------------------------------- /Image/ReadMeImages/result1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CHEREF-Mehdi/SkinDetection/ffbc1ebbc630e51b2d54542daf5807fe198ba639/Image/ReadMeImages/result1.png -------------------------------------------------------------------------------- /Image/ReadMeImages/result2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CHEREF-Mehdi/SkinDetection/ffbc1ebbc630e51b2d54542daf5807fe198ba639/Image/ReadMeImages/result2.png -------------------------------------------------------------------------------- /Image/ReadMeImages/result3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CHEREF-Mehdi/SkinDetection/ffbc1ebbc630e51b2d54542daf5807fe198ba639/Image/ReadMeImages/result3.png -------------------------------------------------------------------------------- /Image/SFA/0/1_HSV.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CHEREF-Mehdi/SkinDetection/ffbc1ebbc630e51b2d54542daf5807fe198ba639/Image/SFA/0/1_HSV.jpg -------------------------------------------------------------------------------- /Image/SFA/0/2_YCbCr.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CHEREF-Mehdi/SkinDetection/ffbc1ebbc630e51b2d54542daf5807fe198ba639/Image/SFA/0/2_YCbCr.jpg -------------------------------------------------------------------------------- /Image/SFA/0/3_global_result.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CHEREF-Mehdi/SkinDetection/ffbc1ebbc630e51b2d54542daf5807fe198ba639/Image/SFA/0/3_global_result.jpg -------------------------------------------------------------------------------- /Image/SFA/0/img (937).jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CHEREF-Mehdi/SkinDetection/ffbc1ebbc630e51b2d54542daf5807fe198ba639/Image/SFA/0/img (937).jpg -------------------------------------------------------------------------------- /Image/SFA/1/1_HSV.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CHEREF-Mehdi/SkinDetection/ffbc1ebbc630e51b2d54542daf5807fe198ba639/Image/SFA/1/1_HSV.jpg -------------------------------------------------------------------------------- /Image/SFA/1/2_YCbCr.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CHEREF-Mehdi/SkinDetection/ffbc1ebbc630e51b2d54542daf5807fe198ba639/Image/SFA/1/2_YCbCr.jpg -------------------------------------------------------------------------------- /Image/SFA/1/3_global_result.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CHEREF-Mehdi/SkinDetection/ffbc1ebbc630e51b2d54542daf5807fe198ba639/Image/SFA/1/3_global_result.jpg -------------------------------------------------------------------------------- /Image/SFA/1/img (589).jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CHEREF-Mehdi/SkinDetection/ffbc1ebbc630e51b2d54542daf5807fe198ba639/Image/SFA/1/img (589).jpg -------------------------------------------------------------------------------- /Image/SFA/2/1_HSV.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CHEREF-Mehdi/SkinDetection/ffbc1ebbc630e51b2d54542daf5807fe198ba639/Image/SFA/2/1_HSV.jpg -------------------------------------------------------------------------------- /Image/SFA/2/2_YCbCr.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CHEREF-Mehdi/SkinDetection/ffbc1ebbc630e51b2d54542daf5807fe198ba639/Image/SFA/2/2_YCbCr.jpg -------------------------------------------------------------------------------- /Image/SFA/2/3_global_result.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CHEREF-Mehdi/SkinDetection/ffbc1ebbc630e51b2d54542daf5807fe198ba639/Image/SFA/2/3_global_result.jpg -------------------------------------------------------------------------------- /Image/SFA/2/img (671).jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CHEREF-Mehdi/SkinDetection/ffbc1ebbc630e51b2d54542daf5807fe198ba639/Image/SFA/2/img (671).jpg -------------------------------------------------------------------------------- /Image/SFA/3/1_HSV.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CHEREF-Mehdi/SkinDetection/ffbc1ebbc630e51b2d54542daf5807fe198ba639/Image/SFA/3/1_HSV.jpg -------------------------------------------------------------------------------- /Image/SFA/3/2_YCbCr.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CHEREF-Mehdi/SkinDetection/ffbc1ebbc630e51b2d54542daf5807fe198ba639/Image/SFA/3/2_YCbCr.jpg -------------------------------------------------------------------------------- /Image/SFA/3/3_global_result.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CHEREF-Mehdi/SkinDetection/ffbc1ebbc630e51b2d54542daf5807fe198ba639/Image/SFA/3/3_global_result.jpg -------------------------------------------------------------------------------- /Image/SFA/3/img (709).jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CHEREF-Mehdi/SkinDetection/ffbc1ebbc630e51b2d54542daf5807fe198ba639/Image/SFA/3/img (709).jpg -------------------------------------------------------------------------------- /Image/SFA/4/1_HSV.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CHEREF-Mehdi/SkinDetection/ffbc1ebbc630e51b2d54542daf5807fe198ba639/Image/SFA/4/1_HSV.jpg -------------------------------------------------------------------------------- /Image/SFA/4/20.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CHEREF-Mehdi/SkinDetection/ffbc1ebbc630e51b2d54542daf5807fe198ba639/Image/SFA/4/20.jpg -------------------------------------------------------------------------------- /Image/SFA/4/2_YCbCr.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CHEREF-Mehdi/SkinDetection/ffbc1ebbc630e51b2d54542daf5807fe198ba639/Image/SFA/4/2_YCbCr.jpg -------------------------------------------------------------------------------- /Image/SFA/4/3_global_result.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CHEREF-Mehdi/SkinDetection/ffbc1ebbc630e51b2d54542daf5807fe198ba639/Image/SFA/4/3_global_result.jpg -------------------------------------------------------------------------------- /Image/SFA/5/1_HSV.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CHEREF-Mehdi/SkinDetection/ffbc1ebbc630e51b2d54542daf5807fe198ba639/Image/SFA/5/1_HSV.jpg -------------------------------------------------------------------------------- /Image/SFA/5/2_YCbCr.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CHEREF-Mehdi/SkinDetection/ffbc1ebbc630e51b2d54542daf5807fe198ba639/Image/SFA/5/2_YCbCr.jpg -------------------------------------------------------------------------------- /Image/SFA/5/3_global_result.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CHEREF-Mehdi/SkinDetection/ffbc1ebbc630e51b2d54542daf5807fe198ba639/Image/SFA/5/3_global_result.jpg -------------------------------------------------------------------------------- /Image/SFA/5/img (769).jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CHEREF-Mehdi/SkinDetection/ffbc1ebbc630e51b2d54542daf5807fe198ba639/Image/SFA/5/img (769).jpg -------------------------------------------------------------------------------- /Image/SFA/6/1_HSV.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CHEREF-Mehdi/SkinDetection/ffbc1ebbc630e51b2d54542daf5807fe198ba639/Image/SFA/6/1_HSV.jpg -------------------------------------------------------------------------------- /Image/SFA/6/27.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CHEREF-Mehdi/SkinDetection/ffbc1ebbc630e51b2d54542daf5807fe198ba639/Image/SFA/6/27.jpg -------------------------------------------------------------------------------- /Image/SFA/6/2_YCbCr.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CHEREF-Mehdi/SkinDetection/ffbc1ebbc630e51b2d54542daf5807fe198ba639/Image/SFA/6/2_YCbCr.jpg -------------------------------------------------------------------------------- /Image/SFA/6/3_global_result.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CHEREF-Mehdi/SkinDetection/ffbc1ebbc630e51b2d54542daf5807fe198ba639/Image/SFA/6/3_global_result.jpg -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SkinDetection 2 | Skin detection using HSV & YCbCr color space (Python, OpenCV) 3 | 4 | # About the precedure of detection 5 | The above entire procedure is applied to each and every pixel of the image. 6 | 7 | The RGB image value is converted to HSV as well as YCbCr value, the HSV and YCbCr value of each pixel is compared to the standard values of a skin pixel and the decision is made whether the pixel is a skin pixel or not depending on whether 8 | the values lie in a range of predefined threshold values for each parameter. 9 | 10 | The ranges for a skin pixel used in this algorithm are as follows: 11 | 12 | 0<=H<=17 and 15<=S<=170 and 0<=V<=255 13 | 14 | and 15 | 16 | 0<=Y<=255 and 135<=Cr<=180 and 85<=Cb<=135 17 | 18 | Please cite this method as follow : 19 | 20 | Djamila Dahmani, Mehdi Cheref, Slimane Larabi, 21 | Zero-sum game theory model for segmenting skin regions, 22 | Image and Vision Computing, 23 | Volume 99, 2020, 103925,ISSN 0262-8856, 24 | https://doi.org/10.1016/j.imavis.2020.103925. 25 | 26 | # Experimentation 27 | 28 | #### We have tested the perfomence of this methode using images from two diffrent database : 29 | 30 | ##### HGR (Hand Gesture Recognition) Image Database 31 | 32 | URL : http://sun.aei.polsl.pl/~mkawulok/gestures/ 33 | 34 | ![alt text](https://github.com/CHEREF-Mehdi/SkinDetection/blob/master/Image/ReadMeImages/ROC_HGR.png) 35 | 36 | ##### SFA (A Human Skin Image Database based on FERET and AR Facial Images) Image Database 37 | 38 | URL : http://www.sel.eesc.usp.br/sfa/ 39 | 40 | ![alt text](https://github.com/CHEREF-Mehdi/SkinDetection/blob/master/Image/ReadMeImages/ROC_SFA.png) 41 | 42 | ### In the following images you will see the skin detection results of each color space threshold, and the result of their association 43 | 44 | ![alt text](https://github.com/CHEREF-Mehdi/SkinDetection/blob/master/Image/ReadMeImages/result1.png) 45 | 46 | ![alt text](https://github.com/CHEREF-Mehdi/SkinDetection/blob/master/Image/ReadMeImages/result2.png) 47 | 48 | ![alt text](https://github.com/CHEREF-Mehdi/SkinDetection/blob/master/Image/ReadMeImages/result3.png) 49 | 50 | ### In the following images you will see the skin detection results of this methode using images from two databases SFA and HGR 51 | 52 | ![alt text](https://github.com/CHEREF-Mehdi/SkinDetection/blob/master/Image/ReadMeImages/all_detection.png) 53 | 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /SkinDetection.py: -------------------------------------------------------------------------------- 1 | import cv2 2 | import numpy as np 3 | 4 | #Open a simple image 5 | img=cv2.imread("6_A_hgr2B_id05_1.jpg") 6 | 7 | #converting from gbr to hsv color space 8 | img_HSV = cv2.cvtColor(img, cv2.COLOR_BGR2HSV) 9 | #skin color range for hsv color space 10 | HSV_mask = cv2.inRange(img_HSV, (0, 15, 0), (17,170,255)) 11 | HSV_mask = cv2.morphologyEx(HSV_mask, cv2.MORPH_OPEN, np.ones((3,3), np.uint8)) 12 | 13 | #converting from gbr to YCbCr color space 14 | img_YCrCb = cv2.cvtColor(img, cv2.COLOR_BGR2YCrCb) 15 | #skin color range for hsv color space 16 | YCrCb_mask = cv2.inRange(img_YCrCb, (0, 135, 85), (255,180,135)) 17 | YCrCb_mask = cv2.morphologyEx(YCrCb_mask, cv2.MORPH_OPEN, np.ones((3,3), np.uint8)) 18 | 19 | #merge skin detection (YCbCr and hsv) 20 | global_mask=cv2.bitwise_and(YCrCb_mask,HSV_mask) 21 | global_mask=cv2.medianBlur(global_mask,3) 22 | global_mask = cv2.morphologyEx(global_mask, cv2.MORPH_OPEN, np.ones((4,4), np.uint8)) 23 | 24 | 25 | HSV_result = cv2.bitwise_not(HSV_mask) 26 | YCrCb_result = cv2.bitwise_not(YCrCb_mask) 27 | global_result=cv2.bitwise_not(global_mask) 28 | 29 | 30 | #show results 31 | # cv2.imshow("1_HSV.jpg",HSV_result) 32 | # cv2.imshow("2_YCbCr.jpg",YCrCb_result) 33 | # cv2.imshow("3_global_result.jpg",global_result) 34 | # cv2.imshow("Image.jpg",img) 35 | cv2.imwrite("1_HSV.jpg",HSV_result) 36 | cv2.imwrite("2_YCbCr.jpg",YCrCb_result) 37 | cv2.imwrite("3_global_result.jpg",global_result) 38 | cv2.waitKey(0) 39 | cv2.destroyAllWindows() --------------------------------------------------------------------------------