This is a multi-part message in MIME format.
--------------060103060405040606000505
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Hi Daniel,
Thank you for the new version! I tried it right away on linux and here
are some comments:
- the markerboard for the multi example that is supplied in this zipfile
does not work with the current file reader. One needs to remove the
comment lines and the empty lines, only then it can be loaded
- the multi example builds Profiler.o from src/extra/Profiler.cpp.
Shouldn't this object be put in a lib? Now each application needs to
link against this object, which is pretty ugly imho
- I've attached a slightly edited multi main.c which shows how to access
the marker offset matrices, for 2 reasons:
1) as a question, is this the proper way to access the data from within
ARToolKitPlus (the code is borrowed from artoolkit)?
2) it was handy for me so you might consider to put it in your copy too
thanks again, bye
Raymond
Daniel Wagner wrote:
>Dear AR developer,
>
>ARToolKitPlus version 2.0.1 is ready for download under
>http://studierstube.icg.tu-graz.ac.at/handheld_ar/download/ARToolKitPlus_2.0.1.zip
>
>Version 2.0.1 is primarily a maintenance release. Thanks to all users
>who reported problems and suggested improvements (I hope we were able to
>apply to all of these). We also added a small multi-marker tracking
>example and now provide Linux support for the IdPatGen tool.
>
>thanks,
>Daniel
>
>
>
--
Raymond de Vries, VR Specialist
Insight Services
SARA Computing and Networking Services, PO Box 94613, 1090 GP AMSTERDAM
email: raymond at sara.nl Phone +31-20-5923000 Fax +31-20-6683167
--------------060103060405040606000505
Content-Type: text/x-c++src;
name="main.cpp"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="main.cpp"
/* ========================================================================
* PROJECT: ARToolKitPlus
* ========================================================================
* This work is based on the original ARToolKit developed by
* Hirokazu Kato
* Mark Billinghurst
* HITLab, University of Washington, Seattle
* http://www.hitl.washington.edu/artoolkit/
*
* Copyright of the derived and new portions of this work
* (C) 2006 Graz University of Technology
*
* This framework is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This framework is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this framework; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* For further information please contact
* Dieter Schmalstieg
* <schmalstieg@i ................>
* Graz University of Technology,
* Institut for Computer Graphics and Vision,
* Inffeldgasse 16a, 8010 Graz, Austria.
* ========================================================================
** @a ..... Daniel Wagner
*
* $Id: main.cpp 126 2006-01-26 14:01:41Z daniel $
* @f ...
/* ======================================================================= */
//
// Simple example to demonstrate multi-marker tracking with ARToolKitPlus
// This sample does not open any graphics window. It just
// loads test images and shows use to use the ARToolKitPlus API.
//
#include "ARToolKitPlus/TrackerMultiMarkerImpl.h"
class MyLogger : public ARToolKitPlus::Logger
{
void artLog(const char* nStr)
{
printf(nStr);
}
};
int main(int argc, char** argv)
{
const int width = 320, height = 240, bpp = 1,
numPixels = width*height*bpp;
size_t numBytesRead;
const char *fName = "data/markerboard_480-499.raw";
unsigned char *cameraBuffer = new unsigned char[numPixels];
MyLogger logger;
// try to load a test camera image.
// these images files are expected to be simple 8-bit raw pixel
// data without any header. the images are expetected to have a
// size of 320x240.
//
if(FILE* fp = fopen(fName, "rb"))
{
numBytesRead = fread(cameraBuffer, 1, numPixels, fp);
fclose(fp);
}
else
{
printf("Failed to open %s\n", fName);
delete cameraBuffer;
return -1;
}
if(numBytesRead != numPixels)
{
printf("Failed to read %s\n", fName);
delete cameraBuffer;
return -1;
}
// create a tracker that does:
// - 6x6 sized marker images
// - samples at a maximum of 6x6
// - works with luminance (gray) images
// - can load a maximum of 1 pattern
// - can detect a maximum of 8 patterns in one image
ARToolKitPlus::TrackerMultiMarker *tracker = new ARToolKitPlus::TrackerMultiMarkerImpl<6,6,6,
ARToolKitPlus::PIXEL_FORMAT_LUM, 1, 16>(width,height);
const char* description = tracker->getDescription();
printf("ARToolKitPlus compile-time information:\n%s\n\n", description);
// set a logger so we can output error messages
//
tracker->setLogger(&logger);
// load a camera file. two types of camera files are supported:
// - Std. ARToolKit
// - MATLAB Camera Calibration Toolbox
if(!tracker->init("data/LogitechPro4000.dat", "data/markerboard_480-499.cfg", 1.0f, 1000.0f))
{
printf("ERROR: init() failed\n");
delete cameraBuffer;
delete tracker;
return -1;
}
// the marker in the BCH test image has a thiner border...
tracker->setBorderWidth(0.125f);
// set a threshold. we could also activate automatic thresholding
tracker->setThreshold(160);
// let's use lookup-table undistortion for high-speed
// note: LUT only works with images up to 1024x1024
tracker->setUndistortionMode(ARToolKitPlus::UNDIST_LUT);
// RPP is more robust than ARToolKit's standard pose estimator
//tracker->setPoseEstimator(ARToolKitPlus::POSE_ESTIMATOR_RPP);
// switch to simple ID based markers
// use the tool in tools/IdPatGen to generate markers
tracker->setMarkerMode(ARToolKitPlus::MARKER_ID_SIMPLE);
// do the OpenGL camera setup
//glMatrixMode(GL_PROJECTION)
//glLoadMatrixf(tracker->getProjectionMatrix());
// here we go, just one call to find the camera pose
int numDetected = tracker->calc(cameraBuffer);
// use the result of calc() to setup the OpenGL transformation
//glMatrixMode(GL_MODELVIEW)
//glLoadMatrixf(tracker->getModelViewMatrix());
printf("\n%d good Markers found and used for pose estimation.\nPose-Matrix:\n ", numDetected);
for(int i=0; i<16; i++)
printf("%.2f %s", tracker->getModelViewMatrix()[i], (i%4==3)?"\n " : "");
const ARToolKitPlus::ARMultiMarkerInfoT *artkpConfig = tracker->getMultiMarkerConfig();
printf("%d markers defined in multi marker cfg\n", artkpConfig->marker_num);
printf("marker matrices:\n");
for(int multiMarkerCounter = 0; multiMarkerCounter < artkpConfig->marker_num; multiMarkerCounter++) {
printf("marker %d, id %d:\n", multiMarkerCounter, artkpConfig->marker[multiMarkerCounter].patt_id);
for(int row = 0; row < 3; row++) {
for(int column = 0; column < 4; column++)
printf("%.2f ", artkpConfig->marker[multiMarkerCounter].trans[row][column]);
printf("\n");
}
}
delete cameraBuffer;
delete tracker;
return 0;
}
--------------060103060405040606000505--
|