1

I am implementing a feature in my app that needs to take images from camera live feed and send it to server for barcode detection. I already have an message class that I can pass an image to and it will take care the communication with the server. But I am struggling to see how to implement the continuous image sending.

Here as the steps that I see right now- have a loop where I would capture images via AVCapture, then send them to server via my message class(in separate threads?) till on of them returns positive result from the server. Does my logic sound right?

user2067051
  • 99
  • 2
  • 15
  • 1
    This sounds like a disaster. You should spend engineering time finding a way to process the codes on the client. Even if it's super dynamic, you could have the server send processing instructions using Lua or JavaScript or something. – Jason Coco Feb 25 '14 at 07:08
  • Not really my choice. Professor has implemented a system on his server that can detect and process the barcodes in a really smart way, so you don't need to align the phone with the barcode itself. As long as the image is remotely readable, it will detect the barcode. It is aimed for people with eyesight problems, so they can use to get nutrition on different products. – user2067051 Feb 25 '14 at 07:23
  • 1
    I'd still definitely try to port the detection code to the client, but if this is an exercise… you will probably want to send the image frames with as little data as the recognition algorithm will support. If you can use iOS 7, use the new NSURLSession upload tasks to send messages, don't use multiple threads. If you have to support iOS 5 or 6, I suggest making NSOperation subclasses and using an operation queue set to default max concurrent items. – Jason Coco Feb 25 '14 at 07:29
  • It is an independent study class and we are trying deferent approaches. I will bring this to his attention. Currently this app is iOS only. If I don't use threads, how would I send multiple messages? For example, if I want to send 4 pictures per second? – user2067051 Feb 25 '14 at 07:46
  • 1
    Take a look at NSURLSessionUploadTask. You can send multiple of those at once and get notified either via block callback or delegate callback. It's new in 7 and super easy to use. – Jason Coco Feb 25 '14 at 07:56

0 Answers0