none
Color Basics-D2D only saves 1 .bmp per second how can I make it faster? RRS feed

  • Question

  • I just downloaded sdk v1.5 and am trying to modify the Color Basics-D2D c++ sample code so that I can capture and save bitmaps from the color data stream. 

    The sample program provides the user with a "screen shot" button  to use when they want to save a single .bmp.  I however want to save many bitmaps per-second so I removed the "if test" that checks to see if the screen shot button was pressed.

    This has allowed me to continously save bitmap images without having to constantly be pressing the "save screen shot" button. However, it is only saving 1 new bitmap a second. I'm fairly sure that the kinect can record data at 30fps. So what is limiting me to saving only 1 bitmap a second when I should be getting 30ish bitmaps a second.
    Friday, June 8, 2012 2:51 PM

All replies

  • Kinect is likely not the limiting factor here. Disk I/O, generally, is slow. If you want to capture many frames in rapid succession, you should probably copy each frame into a queue as you receive it. On a separate thread, process each frame in the queue, write it to disk, then discard it. This will allow the capture thread to continue running at full speed. Keep in mind that if you keep this going for a long time, you'll eventually use a lot of memory.

    John
    K4W Dev

    Friday, June 8, 2012 5:19 PM
  • Well before I was told by my boss that I need to write the program in c++. I managed to modified the c# sample Skeletal viewer program that came with sdk v1.0 to convert the colorimage stream from bitmaps to jpegs and save them to disk. When I did this I was able to generate around 30 jpegs a second.

    And by modify I mean I simply had some code that converted the bitmap the sample program created to a jpeg. I didn't create any extra threads or queues or anything like that.

    So, is there something different between these two cases that would account for the difference in the number of pictures I am able to save?


    • Edited by Mjolnir91 Friday, June 8, 2012 5:52 PM
    Friday, June 8, 2012 5:49 PM
  • Without seeing your code, it's really not possible to tell.

    John
    K4W Dev

    Friday, June 8, 2012 8:19 PM