Commit c0314006 authored by Will Brennan's avatar Will Brennan

Updated main to include SuperContour method

parent 4658a089
...@@ -138,9 +138,15 @@ def process(image, save=False, display=False, args=None, segment=False): ...@@ -138,9 +138,15 @@ def process(image, save=False, display=False, args=None, segment=False):
args.display = display args.display = display
detector = SkinDetector(args) detector = SkinDetector(args)
if segment: if segment:
slic = SpeedySuperPixels. slic = SpeedySuperPixels.SuperContour()
contours = skin = numpy.zeros(image.shape, dtype=image.dtype)
pass for roi, contour in slic.process(image):
pxl = cv2.bitwise_and(image, image, mask=contour)
msk = detector.process(pxl)
ret = msk.sum()/contour.sum()
if ret > 0.8:
skin = numpy.min(255, cv2.add(skin, contour))
return skin
else: else:
return detector.process(image) return detector.process(image)
......
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