Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

built for Linux but with a few issues #1

Open
GoogleCodeExporter opened this issue Mar 21, 2016 · 12 comments
Open

built for Linux but with a few issues #1

GoogleCodeExporter opened this issue Mar 21, 2016 · 12 comments

Comments

@GoogleCodeExporter
Copy link

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 [email protected] on 9 Dec 2010 at 3:35

@GoogleCodeExporter
Copy link
Author

[deleted comment]

@GoogleCodeExporter
Copy link
Author

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 [email protected] on 16 Dec 2010 at 7:10

@GoogleCodeExporter
Copy link
Author

I have the same problem with glibc (double free or corruption)... Did you fixed 
it?

Thank you
Juan

Original comment by [email protected] on 12 Mar 2011 at 11:22

@GoogleCodeExporter
Copy link
Author

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 [email protected] on 17 Mar 2011 at 2:26

@GoogleCodeExporter
Copy link
Author

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 [email protected] on 19 Mar 2011 at 5:13

@GoogleCodeExporter
Copy link
Author

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 [email protected] on 29 Mar 2011 at 5:29

@GoogleCodeExporter
Copy link
Author

sent to your email address.

Or at least i guess, is it [email protected]?

Original comment by [email protected] on 23 Apr 2011 at 3:04

@GoogleCodeExporter
Copy link
Author

anyways our most common crash now is a ***glibc detected *** double free or 
corruption

Original comment by [email protected] on 24 Apr 2011 at 6:50

@GoogleCodeExporter
Copy link
Author

bug solved email me to have the code

Original comment by [email protected] on 28 Apr 2011 at 4:14

@GoogleCodeExporter
Copy link
Author

can you guys send the working project on [email protected]

Original comment by [email protected] on 24 Jun 2011 at 10:07

@GoogleCodeExporter
Copy link
Author

any update on a windows version?

Original comment by [email protected] on 25 Sep 2011 at 9:10

@GoogleCodeExporter
Copy link
Author

can anyone send me a working project copy too? Email: [email protected]
many many thanks in advice :)

Original comment by [email protected] on 11 Nov 2012 at 8:42

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant