I am using the simpleOpenni library in order to retrieve the point cloud from a Kinect. Then I take three random real world points and I calculate the parameters of the plane equations on me own using this method from this site:
http://www.had2know.com/academics/equation-plane-through-3-points.html (Actually I use Matlab for the calculations). Afterwards I put every real world point form the point cloud to the equation hoping that I took a result close to zero...The problem is that I obtain very large number instead....Can you help me please?
import SimpleOpenNI.*;
SimpleOpenNI context;
float zoomF =0.3f;
float rotX = radians(180); // by default rotate the hole scene 180deg around the x-axis,
// the data from openni comes upside down
float rotY = radians(0);
int index;
PVector [] p=new PVector [304635];
void setup()
{
frameRate(300);
size(640,480,P3D); // strange, get drawing error in the cameraFrustum if i use P3D, in opengl there is no problem
//context = new SimpleOpenNI(this,SimpleOpenNI.RUN_MODE_SINGLE_THREADED);
context = new SimpleOpenNI(this);
// disable mirror
context.setMirror(false);
// enable depthMap generation
if(context.enableDepth() == false)
{
println("Can't open the depthMap, maybe the camera is not connected!");
exit();
return;
}
stroke(255,255,255);
smooth();
perspective(radians(45),
float(width)/float(height),
10,150000);
}
void draw()
{
// update the cam
context.update();
background(0,0,0);
translate(width/2, height/2, 0);
rotateX(rotX);
rotateY(rotY);
scale(zoomF);
int[] depthMap = context.depthMap();
int steps =10; // to speed up the drawing, draw every third point
PVector realWorldPoint;
int z=0;
translate(0,0,-1000); // set the rotation center of the scene 1000 infront of the camera
point(realWorldPoint.x,realWorldPoint.y,realWorldPoint.z); // make realworld z negative, in the 3d drawing coordsystem +z points in the direction of the eye
I have a point cloud with x,y,z points and I would like to calculate the normal vectors in every point and draw them too. Could you give me a tip of how to do this? Thank you
I would like to draw vectors with different origins. How this is possible as in
PVector() you can assign only the end of the vector? I used translate() function but changes the origin of all the draw panel.
I would like to add the elements of an array 70x70 for example, in a way that the result will be a new 35x35 array where the first element new [0,0] will be the result for the addition of the array[0,0]+array[0,69]+array[69,0]+array[69,69] , the new [0,2]= array[0,2] + array[0,68]+array[69,2]+array[69,68] and etc. Any ideas?
I would like to ask a question about kinect. I am using the simple openni library and I would like to make a code which is possible to separate the floor pixels for the obstacles pixels. Is there any library available which can help me to implement this or any kind of code which I can use as reference?
I would like to ask some help. Is there any code or suitable library to partitioning an image, ie. having an 640x480 image, separates it into 70x70 segments ?