HalfdanJ / ofxARCore

Experimental addon for openFrameworks to use ARCore on Android devices
Apache License 2.0
182 stars 28 forks source link

New version & Augmented Images #21

Open boehm-e opened 5 years ago

boehm-e commented 5 years ago

Hi,

Because this project does not seems to be maintained, I forked it, and added some new functionalities ( like Augmented Images (with the new FULL_TRACKING feature )).

You can dl it from here:

https://github.com/boehm-e/ofxARCore

Cheers

johanjohan commented 5 years ago

thank you @boehm-e !

HalfdanJ commented 5 years ago

Nice one, yeah I've unfortunately not had any projects that gave me an opportunity to update the library. Would you be interesting creating a PR with these changes to this repo?

boehm-e commented 5 years ago

Yes of course :)

boehm-e commented 5 years ago

I added HitPose API too :


void DrawApp::touchDown(int x, int y, int id) {

  ofHitPose *hitPose = arcore->getHitPose(x, y);

  if (pose != NULL) {
    ofMatrix4x4 pose = hitPose->pose;
    float distance   = hitPose->distance;
  }

}
boehm-e commented 5 years ago

I added PlaneDetection API :


void ofApp::draw() {

    vector<ofARPlane*> planes = arcore->getPlanes();

    // for each plane
    for (int i = 0; i < planes.size(); i++) {

        // translate to it's center
        ofARPlane *plane= planes[i];
        ofPushMatrix();
        ofMultMatrix(plane->center);

        // draw a red box on it's center
        ofSetColor(255,0,0,100);
        ofDrawBox(0,0.025,0, 0.2, 0.05, 0.1);

        // draw the plane
        ofSetColor(0,255,0,100);
        plane->mesh.draw();

        // draw the path (contours)
        ofSetColor(0,0,255,100);
        plane->path.draw();

        ofPopMatrix();
    }
johanjohan commented 5 years ago

so good to see this revitalizing

boehm-e commented 5 years ago

I created a new repo on my GitHub (because fork has no visibility). Happy you enjoy it. If you want more functionalities tell me, I think there should be more projects that use arcore... Here is a video of to the plane API test : https://youtu.be/t8fvPyDhPHA

johanjohan commented 5 years ago

@boehm-e A great feature would be the integration of the camera api since i need to synchronize the cam with devices like video projectors. The wrong shutter speed kills the tracking and target recognition. This seems to be possible by now: https://developers.google.com/ar/develop/java/camera-sharing