Changing cColor Width and Hieght in Unity CoordinateMapperManager RRS feed

  • Question

  • Hey everyone,

    I'm trying to use the Green Screen sample code to make an outline of a person. It works fine however it is pretty slow. I was looking into what was making it so slow and it looks like it's line 52 in the CoordinateMapperView.cs


    I assumed this took so long because depthPoints was large. DepthPoints is set in the CoordinateMapperManager on line 41

    m_pDepthCoordinates = new DepthSpacePoint[cColorWidth * cColorHeight];

    cColorWidth is 1920 and cColorHeight is 1080 so I thought I would lower the resolution to another 16:9 size. I tried 1600:900 but anytime I would run the game it would give me this error

    ArgumentException: Value does not fall within the expected range.
    Rethrow as ArgumentException: This API has returned an exception from an HRESULT: 0x80070057
    Helper.ExceptionHelper.CheckLastError () (at Assets/Standard Assets/ExceptionHelper.cs:39)
    Windows.Kinect.ColorFrame.CopyConvertedFrameDataToIntPtr (IntPtr frameData, UInt32 size, ColorImageFormat colorFormat) (at Assets/Standard Assets/KinectSpecialCases.cs:272)
    CoordinateMapperManager.Update () (at Assets/GreenScreen/Scripts/CoordinateMapperManager.cs:156)

    I'm not sure how to fix this error as the error is coming from an external function.

    Is there someway for me to fix this error or another way to speed up the green screen functionality?

    Sunday, November 9, 2014 1:20 AM

All replies