Shop OBEX P1 Docs P2 Docs Learn Events
Problem in processing depth data to avoid obstacles using C# — Parallax Forums

Problem in processing depth data to avoid obstacles using C#

RozaRoza Posts: 11
edited 2013-12-17 21:55 in Robotics
I am trying to use depth data to avoid obstacles for eddie. However I am not getting expected result. Can anybody pls guide me where I made wrong? I want to change kinect setting to near mode and resolution setting to 80x60? Pls tell me also how to do this in my following C# code:

public void ProcessRawFrame(kinect.RawKinectFrames frames)
{
lowestObstacle = ObstaclePosition.Clear;

this.RawFrames = frames;
if (null != this.RawFrames.RawDepthFrameData)
{
short[] pixelData = new short[frames.RawDepthFrameData.Length];
int[] depth = new int[pixelData.Length];
frames.RawDepthFrameData.CopyTo(pixelData, 0);

for (int i = 0; i < pixelData.Length; i++)
{
depth = pixelData >> 3;
if (depth >= 3000 && depth <= 4000)
lowestObstacle = ObstaclePosition.front;
}
}

}

Thank you

Comments

  • RozaRoza Posts: 11
    edited 2013-12-17 21:55
    added the following code.

    public KinectSensor sensor;


    this.sensor.DepthStream.Enable(DepthImageFormat.Resolution80x60Fps30);
    this.sensor.DepthStream.Range=DepthRange.Near;

    But now It shows the error:
    Assembly signing failed; output may not be signed -- Error signing assembly -- The process cannot access the file

    Now I am in great need to solve the problem. I got stuck. Please help me!!

    Thanks
Sign In or Register to comment.