Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8283879
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T10:53:59+00:00 2026-06-08T10:53:59+00:00

I am following the RecorderPlay example in the simple-openni library for processing: http://code.google.com/p/simple-openni/ It

  • 0

I am following the RecorderPlay example in the simple-openni library for processing:

http://code.google.com/p/simple-openni/

It records to an ONI file, a type of video format which retains depth and rgb information. Currently though, it captures the entire image, and I want to be able to capture only a certain z depth range. Does anyone know if this is possible?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T10:54:01+00:00Added an answer on June 8, 2026 at 10:54 am

    I don’t think you can configure what depth range to record, but what you could do is process the information you read from the .oni recording:

    import SimpleOpenNI.*;
    
    SimpleOpenNI  context;
    boolean       recordFlag = true;
    boolean       saving = false;
    int frames = 0;
    int savedFrames = 0;
    //change these two values as you wish:
    float minZ = 100;
    float maxZ = 500;
    
    void setup(){
      context = new SimpleOpenNI(this);
    
      if(! recordFlag){
        if(! context.openFileRecording("test.oni") ){
          println("can't find recording !!!!");
          exit();
        }
        context.enableDepth();
      }else{  
        // recording
        context.enableDepth();
        // setup the recording 
        context.enableRecorder(SimpleOpenNI.RECORD_MEDIUM_FILE,"test.oni");
        // select the recording channels
        context.addNodeToRecording(SimpleOpenNI.NODE_DEPTH,SimpleOpenNI.CODEC_16Z_EMB_TABLES);
      }
      // set window size 
      if((context.nodes() & SimpleOpenNI.NODE_DEPTH) != 0)
        size(context.depthWidth() , context.depthHeight());
      else 
        exit();
    }
    void draw()
    {
      background(0);
      context.update();
      if((context.nodes() & SimpleOpenNI.NODE_DEPTH) != 0) image(context.depthImage(),0,0);
      if(recordFlag) frames++;
      if(saving && savedFrames < frames){
          delay(3000);//hack
          int i = savedFrames;
          int w = context.depthWidth();
          int h = context.depthHeight();
          PrintWriter output = createWriter(dataPath("frame_"+i+".ply"));
          output.println("ply");
          output.println("format ascii 1.0");
          output.println("element vertex " + (w*h));
          output.println("property float x");
          output.println("property float y");
          output.println("property float z");
          output.println("end_header\n");
          rect(random(width),random(height),100,100);
          int[]   depthMap = context.depthMap();
          int     index;
          PVector realWorldPoint;
          for(int y=0;y < h;y++){
            for(int x=0;x < w;x++){
              index = x + y * w;
              realWorldPoint = context.depthMapRealWorld()[index];
              if(realWorldPoint.z > minZ && realWorldPoint.z < maxZ)
                output.println(realWorldPoint.x + " " + realWorldPoint.y + " " + realWorldPoint.z);
            }
          }
          output.flush();
          output.close();
          println("saved " + (i+1) + " of " + frames);
          savedFrames++;
      }
    }
    void keyPressed(){
      if(key == ' '){
        if(recordFlag){
          saveStrings(dataPath("frames.txt"),split(frames+" ",' '));
          exit();
        }else saveONIToPLY();
      }
    }
    void saveONIToPLY(){
      frames = int(loadStrings(dataPath("frames.txt"))[0]);
      saving = true;
      println("recording " + frames + " frames");
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Following chunk html code works as expected: <iframe src=http://www.amazon.com/></iframe> But when trying embed inner
Following is the my code for getting direction detail.. <html> <head> <meta http-equiv=content-type content=text/html;
Following this documentation ( https://docs.djangoproject.com/en/dev/topics/http/views/#customizing-error-views ), I am trying to create a custom error
Following example code from the libpcap documentation yields the following code which should report
Following the instructions here: http://www.padrinorb.com/guides/padrino-mailer I have the delivery method added on the app.rb
Following this tutorial: http://viralpatel.net/blogs/2010/07/spring-3-mvc-tiles-plugin-tutorial-example-eclipse.html Tiles configuration ( tiles.xml ) : <?xml version=1.0 encoding=UTF-8 ?>
Following is my code saved as .cpp file and .c file in .c it
Following this: http://developer.android.com/training/basics/firstapp/starting-activity.html I am confused when editing the Android Manifest.xml file. It says
Following the README at https://github.com/magarciaEPFL/scaladotnet to create a Windows exe for a simple Hello
Following code produces a nested array as a result for keys containing three items:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.