flydayboy / tuiokinect

Automatically exported from code.google.com/p/tuiokinect
0 stars 0 forks source link

built for Linux but with a few issues #1

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Hi,

I've managed to build this code for Linux, with Code::blocks but I had to 
comment out the following lines from TuioKinect.cpp:

freenect_set_rgb_callback...
freenect_set_rgb_format...
freenect_start_rgb...
freenect_get_raw_accel...

I assume I'm using the wrong library version or something. I haven't hooked up 
my Kinect HW yet. Can you comment on why I need to remove the above lines? 
Should they be replaced with something else?

Thanks

Original issue reported on code.google.com by mph070...@gmail.com on 9 Dec 2010 at 3:35

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Got it compling under Linux (Ubuntu 10.10), but only runs for 1-2 seconds and 
aborts.

Output:
TUIO/UDP messages to 127.0.0.1@3333
*** glibc detected **** <path>/kinectExample_debug: double free or corruption 
(!prev): 0x099ceb60

Original comment by ricardo....@gmail.com on 16 Dec 2010 at 7:10

GoogleCodeExporter commented 8 years ago
I have the same problem with glibc (double free or corruption)... Did you fixed 
it?

Thank you
Juan

Original comment by jpman...@gmail.com on 12 Mar 2011 at 11:22

GoogleCodeExporter commented 8 years ago
got the same problem of ricardo under ubuntu 10.10 32 bits, i noticed that 
crashes after the tuio view sees more than 3 points, otherwise it works 
correctly

Original comment by romagnol...@gmail.com on 17 Mar 2011 at 2:26

GoogleCodeExporter commented 8 years ago
RESOLVED:

in testApp.cpp file, find the TuioKinect::update() methdo and write it as 
follows:

void TuioKinect::update()
{
    tuioServer->stopUntouchedMovingCursors();

    //std::list<TuioCursor*> dead_cursor_list = tuioServer->getUntouchedCursors();
    //std::list<TuioCursor*>::iterator dead_cursor;

    //for (dead_cursor=dead_cursor_list.begin(); dead_cursor!= dead_cursor_list.end(); dead_cursor++) {
        //clearKalman((*dead_cursor)->getCursorID());
    //}

    tuioServer->removeUntouchedStoppedCursors();

    kinect.update();

    grayImage.setFromPixels(kinect.getDepthPixels(), kinect.width, kinect.height);
    grayImage.mirror(false, true);

    unsigned char * pix = grayImage.getPixels();
    int numPixels = grayImage.getWidth() * grayImage.getHeight()-1;

    depthImage.setFromPixels(pix, kinect.width, kinect.height);
    depthImage.flagImageChanged();

    colorImage.setFromPixels(kinect.getPixels(), kinect.width, kinect.height);
    colorImage.mirror(false, true);
    colorImage.convertToGrayscalePlanarImage(redImage, 0);

//colora i pixel di bianco che si trovano davanti alla near e dietro alla far

    for(int i = numPixels; i > 0 ; i--){
        if( pix[i] > nearThreshold && pix[i] < farThreshold ){
            pix[i] = 255;
        }else{
            pix[i] = 0;
        }
    }

    //update the cv image
    grayImage.flagImageChanged();

    unsigned char * red = redImage.getPixels();
    numPixels = redImage.getWidth() * redImage.getHeight();

    contourFinder.findContours(grayImage, 900, (kinect.width*kinect.height)/8, 20,true, true);

    TuioTime frameTime = TuioTime::getSessionTime();
    tuioServer->initFrame(frameTime);

    std::vector<ofxCvBlob>::iterator blob;
    for (blob=contourFinder.blobs.begin(); blob!= contourFinder.blobs.end(); blob++) {
        float xpos = (*blob).centroid.x;
        float ypos = (*blob).centroid.y;

        TuioPoint tp(xpos/kinect.width,ypos/kinect.height);
        if ((tp.getY() > 0.8) && (tp.getX()>0.25) && (tp.getX()<0.75)) continue;

        TuioCursor *tcur = tuioServer->getClosestTuioCursor(tp.getX(),tp.getY());
        if ((tcur==NULL) || (tcur->getDistance(&tp)>0.2)) {
            tcur = tuioServer->addTuioCursor(tp.getX(), tp.getY());
            updateKalman(tcur->getCursorID(),tcur);
        } else {
            TuioPoint kp = updateKalman(tcur->getCursorID(),tp);
            tuioServer->updateTuioCursor(tcur, kp.getX(), kp.getY());
        }
    }

    tuioServer->commitFrame();
}
}

in this way the program stops to crash after a little while!

Original comment by romagnol...@gmail.com on 19 Mar 2011 at 5:13

GoogleCodeExporter commented 8 years ago
Could one of you maybe send your working Codeblocks project file and/or 
Makefile for Linux, so I can test and provide that with the next release? 
thanks, Martin.k

Original comment by pozof...@gmail.com on 29 Mar 2011 at 5:29

GoogleCodeExporter commented 8 years ago
sent to your email address.

Or at least i guess, is it pozofrio@gmail.com?

Original comment by romagnol...@gmail.com on 23 Apr 2011 at 3:04

GoogleCodeExporter commented 8 years ago
anyways our most common crash now is a ***glibc detected *** double free or 
corruption

Original comment by romagnol...@gmail.com on 24 Apr 2011 at 6:50

GoogleCodeExporter commented 8 years ago
bug solved email me to have the code

Original comment by romagnol...@gmail.com on 28 Apr 2011 at 4:14

GoogleCodeExporter commented 8 years ago
can you guys send the working project on r.kamun@gmail.com

Original comment by R.Ka...@gmail.com on 24 Jun 2011 at 10:07

GoogleCodeExporter commented 8 years ago
any update on a windows version?

Original comment by ved...@skarica.com on 25 Sep 2011 at 9:10

GoogleCodeExporter commented 8 years ago
can anyone send me a working project copy too? Email: stanislasma@gmail.com
many many thanks in advice :)

Original comment by Stanisla...@gmail.com on 11 Nov 2012 at 8:42