How to apply Skin Detector to only a subregion of an image.
Closed this issue · 1 comments
EmmanuelEzenwere commented
could you guide me on how I can do this
WillBrennan commented
import cv2
import skin_detector
img_path = raw_input("Please Enter Image Path")
image = cv2.imread(img_path)
image_region = image[400:1000, 500:600]
mask_region = skin_detector.process(image_region)
mask = numpy.zeros(image.shape[:2])
mask[400:1000, 500:600] = mask_region
cv2.imshow("input", image)
cv2.imshow("mask", mask)
cv2.waitKey(0)