Click here to Skip to main content
15,886,798 members
Please Sign up or sign in to vote.
4.33/5 (2 votes)
See more:
I'm working on a project in c# which I'm capturing color and depth frame from Kinect, then I'm doing some real-time process on them, kinect capturing with resolution 640*480 is 30FPS, but I don't need all the frames and I want to reduce the frame rate to be about 15FPS. Would you please help me with any instruction or sample code.

Thanks in advance :)
Posted
Comments
[no name] 25-Dec-13 8:31am    
Seems to be a constant, but until now I'm not completely clear about that. How is about only processing each second frame for a first guess?
niloufar.M 25-Dec-13 9:21am    
Actually I need at least 10FPS. how can I process some and ignore the rest?
[no name] 25-Dec-13 9:26am    
Google for "Setting kinect frame rate"

http://www.codeproject.com/Articles/248684/Kinect-Reception

http://msdn.microsoft.com/en-us/library/hh438998.aspx

I do not know the tech background of the kinect API. But I assume you will get some events for each frame. If this is the case it should be no problem to process only each second frame.
niloufar.M 25-Dec-13 9:58am    
For sure I did google it, and yes there are events for each frame. there is a method setFrameRate but I need sample code for that as I cannot use it in my project and I don't know why, I think it is because some changes in kinect library in the latest release.
[no name] 25-Dec-13 10:08am    
How is about the lazy approach:
A static int frameCount (or better a member in your "processing class"). Every time you recive a frame event you incerement it. And depending on an divisior at your choice you process the frame?

static int frameCount;
frameCount= frameCount++ % 2; // 2 is the divisor
if (frameCount == 0)
{
// Process
}

1 solution

You can change the frame interval by changing the value of ColorCameraSettings.FrameInterval property.

You have to make sure the AutoExposure property is set to false while working with FrameInterval; otherwise there will have no effects on the frames.
Use this like :
this.sensor.ColorStream.CameraSettings.FrameInterval = 12

I did a post over here couple of months back, How to control the frame interval of Kinect color data stream? [^]
Hope this will help you !
 
Share this answer
 
v2
Comments
niloufar.M 2-Jan-14 5:43am    
Thanks dear Permalink, I solved this using the lazy approach of counting frame and just process some of them. your solution is also great :)
Abhijit Jana 2-Jan-14 5:48am    
Yeah, I have read the complete post and your conversation. I thought to late you know that something available inbuilt with SDK :) . Have a great day my friend !
niloufar.M 2-Jan-14 6:55am    
I'm new to this field. Thanks:) you too
niloufar.M 4-Jan-14 6:18am    
Dear Abhijit thanks again, I'm trying to use your solution but I have this error: The feature is not supported by this version of the hardware. I'm working with SDK 1.7
Abhijit Jana 4-Jan-14 13:42pm    
You need Kinect for Windows Device. I think you are using Kinect for Xbox Sensor.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900