title: convert PIX object to UIImage
body: <p>I am trying to apply a threshold using the leptonica image library with the function</p>
  
  <pre><code>l_int32 pixOtsuAdaptiveThreshold()
  </code></pre>
  
  <p>I believe I have succesfully used this function but as you can see, it returns an int. I am not sure how to go from here and convert this into a UIImage OR convert the PIX object I passed in into an UIImage? Basically I just want a UIImage back after applying the threshold.</p>
  
  <p>The API for this function can be found here: <a href="http://tpgit.github.io/Leptonica/binarize_8c.html#aaef1d6ed54b87144b98c72f675ad7a4c" rel="nofollow">http://tpgit.github.io/Leptonica/binarize_8c.html#aaef1d6ed54b87144b98c72f675ad7a4c</a></p>
  
  <p>Does anyone know what I must do to get a UIImage back?</p>
  
  <p>Thanks!</p>