I have two algorithms, that detects AR markers (ARToolKit and Infi). I have them working on iPhone in real time detecting markers. At this stage i would like to compare their speed and accuracy. I would like to prepare a series of images and test recognition on them. I can do that with infi, but i can't manage to use ARToolKit with UIImage.
ARToolKit uses CVImageBuffer to recognize markers:
- (Marker *)detectMarkerInImageBuffer:(CVImageBufferRef)imageBuffer {
/*We lock the buffer and get the address of the first pixel*/
CVPixelBufferLockBaseAddress(imageBuffer,0);
unsigned char *baseAddress = (unsigned char *) CVPixelBufferGetBaseAddress(imageBuffer);
tracker->calc(baseAddress);
How can I use/convert UIImage to achieve baseAddress, so i can send it to tracker->calc ?
With infi I first create IplImage from buffer or convert UIImage to IplImage and then in both cases:
Buffer* buffer = new Buffer();
buffer->setBuffer( (unsigned char *) iplImg->imageData, iplImg->width, iplImg->height);