PyConKinectHowOld.py 文件源码

python
阅读 31 收藏 0 点赞 0 评论 0

项目:KinectHowOld 作者: crwilcox 项目源码 文件源码
def __init__(self):
        pygame.init()


        # Used to manage how fast the screen updates
        self._clock = pygame.time.Clock()

        # Set the width and height of the screen [width, height]
        self._infoObject = pygame.display.Info()
        self._screen = pygame.display.set_mode(
            (self._infoObject.current_w >> 1, self._infoObject.current_h >> 1),
            pygame.HWSURFACE | pygame.DOUBLEBUF | pygame.RESIZABLE, 32
        )

        pygame.display.set_caption("Guess your Age!")

        # Loop until the user clicks the close button.
        self._done = False

        # Kinect runtime object, we want only color and body frames
        if PyKinectRuntime and USE_KINECT:
            self._kinect = PyKinectRuntime.PyKinectRuntime(
                PyKV2.FrameSourceTypes_Color |
                PyKV2.FrameSourceTypes_Body
            )
            frame_dimension = (
                self._kinect.color_frame_desc.Width,
                self._kinect.color_frame_desc.Height
            )
        else:
            self._kinect = None
            frame_dimension = 800, 600

        # back buffer surface for getting Kinect color frames, 32bit color,
        # width and height equal to the Kinect color frame size
        self._frame_surface = pygame.Surface(frame_dimension, 0, 32)

        # here we will store skeleton data
        self._bodies = None
        self._stored_bodies = {}

        self._faces = []
        self._face_bodies = []

        self._update_oxford = 0
        self.python_logo_image = pygame.image.load('pylogo.png')
        self.msft_logo_image = pygame.image.load('microsoftlogo.png')

        self.bg_color = pygame.Color(55, 117, 169)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号