3

I'm using ABBYY OCR SDK and it's great at text recognition direct from camera from CMSampleBuffer in:

func captureOutput(_ captureOutput: AVCaptureOutput!, didOutputSampleBuffer sampleBuffer: CMSampleBuffer!, from connection: AVCaptureConnection!) 

They've got another SDK for image recognition using which however will increase the app size for a couple of dozen Mb.

So wondering if there is any way to convert UIImage to CMSampleBuffer.

Dmitrii Z
  • 145
  • 1
  • 5
  • Why not just pass the sample buffer directly to the other sdk? I can't understand what you are trying to achieve. – Pochi Jun 30 '17 at 00:05
  • I want to recognise text from UIImage (from photo library) not from camera. And do not want to use second framework to do it – Dmitrii Z Jun 30 '17 at 00:09
  • I'd suggest checking carefully the sdk. Since it is almost 90% likely that its not using a sample buffer, but instead its internally changing it into some kind of processable data. Does the sdk provide any other kind of available inputs? – Pochi Jun 30 '17 at 01:06
  • the only method they use is: grab CMSampleBuffer and return text (or error) – Dmitrii Z Jun 30 '17 at 02:34
  • Try this: https://stackoverflow.com/questions/16475737/convert-uiimage-to-cmsamplebufferref – Pochi Jun 30 '17 at 02:39
  • Yeah, I saw it. but could not reproduce the code on swift.. Used Several solutions but the only thing I achieved is leaking memory.. anyway, Thanks! – Dmitrii Z Jun 30 '17 at 04:26

0 Answers0