willbrennan / skindetector Goto Github PK
View Code? Open in Web Editor NEWA Python based skin detection system using OpenCV
License: MIT License
A Python based skin detection system using OpenCV
License: MIT License
Yo, Appreciate your work.
However , when I try to use , I cannot produce the image shown in the demonstration.
My code :
image = cv2.imread("path_of_img")
mask = skin_detector.process(image)
cv2.imwrite(os.path.expanduser("path_destination_result"), mask)
However, I want to have the result output image to keep its original skin color , Please Help , Thanks so much !
Is there any way to produce the RGB values of the skin in the console output? Something similar to how the output is produced as segments here But, I'm only wanting to produce a single RGB value for the skin. Any help would be highly appreciated!
could you guide me on how I can do this
The link in Based Upon section is no longer available, please check it.
I am using opencv 4.2
and not sure whether it's a bug on early version.
I found that the returned HSV mask was almost empty (all zero), so I went deep into the codes and found 2 problems.
The default color space of opencv is BGR, so the second parameter of cvtColor
should be COLOR_BGR2HSV
/COLOR_BGR2YCrCb
. Accordingly, the threshold of YCrCb should also change to [90, 130, 100] ~ [230, 180, 120] (swap Cr and Cb channel)
The upper threshold of HSV may be [20, 150, 255]. H channel from 0 to 120 is too wide. The range of H channel in opencv is 0~180.
Hello William! Congratulations, this is a wonderfull script. Well I found something interesting and related with the issue #11 . Every time the program runs, it outputs a mask with only one chanel. That's why it generates black and white images. This is intentional? Thank you very much for this library!
I'm using this for video redaction of body parts. Could you please add a way to increase sensitivity?
I am runing opencv 3.0, python 3.5 in ubuntu 16.04
When I run:
python main.py ~/MovieProcessing/alvaro/delete/p6-1.png --display
I get the error
OpenCV Error: Sizes of input arguments do not match (The operation is neither 'array op array' (where arrays have the same size and type), nor 'array op scalar', nor 'scalar op array') in binary_op, file /home/aulloa/src/opencv/modules/core/src/arithm.cpp, line 225
Traceback (most recent call last):
File "main.py", line 197, in
img_msk = process(img_col, args=args)
File "main.py", line 188, in process
return detector.process(image)
File "main.py", line 125, in process
self.get_mask_rgb(img)
File "main.py", line 61, in get_mask_rgb
msk_rgb = cv2.bitwise_and(mask_a, mask_b)
cv2.error: /home/aulloa/src/opencv/modules/core/src/arithm.cpp:225: error: (-209) The operation is neither 'array op array' (where arrays have the same size and type), nor 'array op scalar', nor 'scalar op array' in function binary_op
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.