Quantcast
Channel: arm - openFrameworks
Viewing all articles
Browse latest Browse all 147

Raspberry Pi and ofxAruco

$
0
0

OF11.0
RP3B (Buster)
Pi camera v2.1

Hi all,
I’m trying to merge @arturo’s ofxAruco and @jvcleave’s ofxOMXcamera to be able to do some marker tracking using the Raspberry Pi.

After a lot of collisions between the Pi’s libraries and all the addons, I finally managed to make it compile without errors but I still do not get the Aruco marker (it works on laptop and using the PS3eye on the Pi with the same code).

The problem seems to be that when I try to replace the videoGrabber object for the OMXvideoGrabber there seem to be a few conflicts.

Are there any suggestions for how to get the Pi camera data into the aruco.getBoards() function? here is the relevant code that compiles without detecting the marker:

ofApp.h:

ofxOMXVideoGrabber videoGrabber;

ofApp.cpp:

ofxOMXCameraSettings settings;
	settings.sensorWidth					= 1280;
	settings.sensorHeight				= 720;
	settings.enablePixels = true;

	
	
	videoGrabber.setup(settings);
	filterCollection.setup();
    
	
    aruco.setup("intrinsics.int", settings.sensorWidth, settings.sensorHeight, boardName, markerSize);
    aruco.getBoardImage(board.getPixels());
    board.update();
    
    showMarkers = true;
    //    showBoard = true;
    showBoardImage = false;
    
    ofEnableAlphaBlending();
}

//--------------------------------------------------------------
void ofApp::update()
{
    //videoGrabber.onUpdate();
    if(videoGrabber.isFrameNew()){
        aruco.detectBoards(videoGrabber.getPixels());
    }
}


//--------------------------------------------------------------
void ofApp::draw(){
    ofSetColor(255);
    
	
    videoGrabber.draw(0, 0);

Thanks in advance

2 posts - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 147

Trending Articles