Exemple #1
0
class TestPose():

    def __init__(self, src):
        self._src     = src
        self._kinect  = Kinect()
        self._body    = BodyDetector()
        self._hand    = HandDetector()
        self._contour = HandContourDetector()
        self._pose    = PoseClassifier(MultiPoseClassifier(src))

    def run(self):
        for (depth, depth8, rgb) in self._kinect.get_data():
            contour = self._get_hand_contour(depth8, depth, rgb)

            if contour.any():
                self._contour.draw()
                print self._pose.run(contour)

            cv2.waitKey(5)

    def _get_hand_contour(self, depth8, depth, rgb):
        body            = self._body.run(depth8)
        (hand, _)       = self._hand.run(body)
        (cont, box, hc) = self._contour.run(hand)

        if self._contour.not_valid():
            return np.array([])

        (cont, _, _) = self._contour.run(rgb, True, box, hc, depth)

        return cont
Exemple #2
0
 def __init__(self, src):
     self._src = src
     self._kinect = Kinect()
     self._body = BodyDetector()
     self._hand = HandDetector()
     self._contour = HandContourDetector()
     self._pose = PoseClassifier(MultiPoseClassifier(src))
Exemple #3
0
class TestPose():
    def __init__(self, src):
        self._src = src
        self._kinect = Kinect()
        self._body = BodyDetector()
        self._hand = HandDetector()
        self._contour = HandContourDetector()
        self._pose = PoseClassifier(MultiPoseClassifier(src))

    def run(self):
        for (depth, depth8, rgb) in self._kinect.get_data():
            contour = self._get_hand_contour(depth8, depth, rgb)

            if contour.any():
                self._contour.draw()
                print self._pose.run(contour)

            cv2.waitKey(5)

    def _get_hand_contour(self, depth8, depth, rgb):
        body = self._body.run(depth8)
        (hand, _) = self._hand.run(body)
        (cont, box, hc) = self._contour.run(hand)

        if self._contour.not_valid():
            return np.array([])

        (cont, _, _) = self._contour.run(rgb, True, box, hc, depth)

        return cont
Exemple #4
0
 def __init__(self, src):
     self._src     = src
     self._kinect  = Kinect()
     self._body    = BodyDetector()
     self._hand    = HandDetector()
     self._contour = HandContourDetector()
     self._pose    = PoseClassifier(MultiPoseClassifier(src))
Exemple #5
0
import cv2
import numpy as np
import config

from kinect import Kinect
from body import BodyDetector
from hand import HandDetector, HandContourDetector
from pose import PoseClassifier, OpenCloseClassifier, MultiPoseClassifier


kinect  = Kinect()
body    = BodyDetector()
hand    = HandDetector()
contour = HandContourDetector()
#pose   = PoseClassifier(OpenCloseClassifier())
pose    = PoseClassifier(MultiPoseClassifier())


for (depth, depth8, rgb) in kinect.get_data():

    b = body.run(depth8)
    (h, _) = hand.run(b)

    #cv2.imshow('hand', h)

    (ccc, box, hc) = contour.run(h)

    if len(ccc) < 100:
        continue

    (ccc, _, _) = contour.run(rgb, True, box, hc, depth)
Exemple #6
0
import cv2
import numpy as np
import config

from kinect import Kinect
from body import BodyDetector
from hand import HandDetector, HandContourDetector
from pose import PoseClassifier, OpenCloseClassifier, MultiPoseClassifier


kinect = Kinect()
body = BodyDetector()
hand = HandDetector()
contour = HandContourDetector()
# pose   = PoseClassifier(OpenCloseClassifier())
pose = PoseClassifier(MultiPoseClassifier())


for (depth, depth8, rgb) in kinect.get_data():

    b = body.run(depth8)
    (h, _) = hand.run(b)

    # cv2.imshow('hand', h)

    (ccc, box, hc) = contour.run(h)

    if len(ccc) < 100:
        continue

    (ccc, _, _) = contour.run(rgb, True, box, hc, depth)