> Hi all,
>
> I am trying to use ARToolkit Plus under windows.
>
> I am having trouble correctly detecting the pattern I load into the
> tracker.
> I initialise the tracker as follows:
> tracker = new ARToolKitPlus::TrackerSingleMarkerImpl<16,16,64,
> ARToolKitPlus::PIXEL_FORMAT_RGB>(width,height);
>
> tracker->setLogger(&logger);
> tracker->init("data/LogitechPro4000.dat", 1.0f, 1000.0f);
> tracker->setPatternWidth(80);
> tracker->setBorderWidth(0.250f);
> tracker->setThreshold(150);
Try with a lower threshold, like 80 or so. Also try
to "binarize your image using this threshold in order to
see what artoolkit sees. Perhaps it sees the whole image
"black". Depends very much on your lighting conditions.
Hope that helps,
Toni
P.S.: Code snippet for showing binary image. I'm not 100%
sure if this is what artoolkit does for binarizing, maybe
someone can correct the algorithm for rgb.
if(showBinary)
{
UInt8 * d = image->getData();
for(UInt32 i = image->getWidth() * image->getHeight(); i > 0;
--i, d+=3)
{
if((d[0] + d[1] + d[2]) <= thresh*3 )
d[0] = d[1] = d[2] = 0;
else
d[0] = d[1] = d[2] = 255;
}
}
|