public void extract(Mat image, HandColorProfile handColor) { if (!handColor.getHasColor()) { return; } mask = handColor.getMask(image); contour = getContours(mask); hull = getConvexHull(contour); hullDefectVertices = filterVertices(getDefects()); }
void Start() { ball = GetComponent <Rigidbody>(); handColor = new HandColorProfile(); handGesture = new HandFeatureExtraction(); capture = new VideoCapture(0); windowCap = new Window("capture"); windowCap.CreateTrackbar("Hue range", HandColorProfile.HUE_RANGE, 50, this.hueRangeChange); windowCap.CreateTrackbar("Light range", HandColorProfile.LIGHT_RANGE, 60, this.lightRangeChange); windowCap.CreateTrackbar("Saturation range", HandColorProfile.SATURATION_RANGE, 160, this.satRangeChange); if (capture.IsOpened() == false) { print("Cannot open video camera"); } else { print("Camera started"); } StartCoroutine("cv"); }