title: How to use UIImage with ARToolKitPlus? (UIImage to CVImageBufferRef conversion)
body: <p>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. </p>
  
  <p>ARToolKit uses CVImageBuffer to recognize markers:</p>
  
  <pre><code>- (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-&gt;calc(baseAddress);
  </code></pre>
  
  <p><strong>How can I use/convert UIImage to achieve baseAddress, so i can send it to tracker->calc ?</strong></p>
  
  <p>With infi I first create IplImage from buffer or convert UIImage to IplImage and then in both cases:</p>
  
  <pre><code>Buffer* buffer = new Buffer();
  
  buffer-&gt;setBuffer( (unsigned char *) iplImg-&gt;imageData, iplImg-&gt;width, iplImg-&gt;height);
  </code></pre>