+ Reply to Thread
Results 1 to 8 of 8

Thread: Kinect Point Cloud Animation Help!

  1. #1

    Kinect Point Cloud Animation Help!

    I recently completed a sculpture project, and normally I would do traditional time lapse photography of the construction. This time I also programmed a Kinect that was mounted under the camera to take depth images at the same time. I have all of this data, hundreds and hundreds of scans, processed now into colored point clouds that I can script into Rhino, the thought being that I could have a script bring in a point cloud, update the viewport, take a screen shot, then delete the point cloud, load the next, slightly move the camera, etc.

    I have already approached this a couple of ways unsuccessfully. The first problem was not understanding how to get a point cloud to draw in the display pipeline. I can draw other things, but not the point cloud for whatever reason.

    The second thing I tried involved loading in a point cloud object, redraw, take screen shot etc. Sometimes, I get the first screenshot to have the point cloud in it, most of the time not, then Rhino does the thing where if the script is involved enough, redraw will stop, and only until the operation is complete is the screen ever refreshed. I know this will take a long time, probably an overnight operation.

    Is there some way I can force the viewport to refresh? Is there a .NET method similar to time.sleep() that i can invoke to slow the script down between redraw and screen capture that will not crash Rhino? As a last hacked resort I guess I will add the Python functions into a C# plugin and hit a button to load, hit a button to screen capture and just click every once in a while while I work. Seems like there must be a better way to do this.

    This is going to look insane if I can get it to work and I on posting the code for whoever wants it if I get this working. The Kinect programming was done in Python also. I'm planning to composite these images in Blender once they are done. Attached is an overlay of 10 images. I would composite this at 25 frames a second so, the activity would be really fast.
    Attached Images
    Last edited by frankfralick; 09-06-2012 at 07:44 PM. Reason: Added screenshot

  2. #2
    Senior Member Steve Baer's Avatar
    Join Date
    Apr 2010
    Location
    Seattle
    Posts
    1,464
    Blog Entries
    19
    Hi Frank,
    The viewport should be refreshing for you. Are you calling rhinoscriptsyntax.AddPointCloud?

    Just trying to get a better idea of what you are trying to do.
    Thanks,
    -Steve

  3. #3
    Steve,

    Here is a short youtube clip of me trying some things. This is really manual, I took 24 depth images and loaded them into Rhino, turned all off except one, ran a script that screen captured the visible part, and then manually turned off that cloud and then turned on the next one, and took a screen shot. This is pretty choppy but the first 1 second of the video is closest to what I'm after. http://youtu.be/ZKF6JaYtZ5s

    If i try to run a script to do all of that, It redraws some of it, then stops until it is complete, and i end up with a bunch of blank screen shots. I'm moving the camera by hand in the video each frame, but in the real thing i would have that as part of the script. lots of possibilities, just don't want any of this to be manual or it will take forever.

  4. #4
    Senior Member Steve Baer's Avatar
    Join Date
    Apr 2010
    Location
    Seattle
    Posts
    1,464
    Blog Entries
    19
    I guess I am going to need to see the script in order to be of any help. I can understand what you are trying to accomplish, but I what you are describing "should" already work. There's always a possibility that I need to tune something up and it has nothing to do with your script.

    Thanks,
    -Steve

  5. #5
    I have attached a script that should show you sort of what I want to do. Here is a link to a box.com folder that has .ply files for use with this script. If you download two or three of them and then change the directory name in the script to match the location you save the .ply files, it should run and produce screenshots in that same folder. I just ran this on my machine and got 24 images of the same "not responding" screen. I really appreciate you taking the time to look at something like this!

    .ply files:

    https://beck.box.com/s/ac6nad5uoruj8z63t85e
    Attached Files

  6. #6
    Senior Member Steve Baer's Avatar
    Join Date
    Apr 2010
    Location
    Seattle
    Posts
    1,464
    Blog Entries
    19
    Here's what I could come up with. Let me know if you have any questions.
    Attached Files

  7. #7
    Steve,

    Thanks a lot! I'm not sure why what I was doing wasn't working but your code is definitely going to work. I have played with moving the viewport camera along a curve in each frame as well as changing the lens length over time. I will post a video when I have something worth sharing.

  8. #8
    Here is a demo of 300 scans with the view camera following a curve. Thanks again Steve. http://t.co/1H9FGFfm

+ Reply to Thread

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts