title: Limit Detection Area in Vision API
body: <p>It seems I've found myself in the deep weeds of the Google Vision API for barcode scanning. Perhaps my mind is a bit fried after looking at all sorts of alternative libraries (ZBar, ZXing, and even some for-cost third party implementations), but I'm having some difficulty finding any information on where I can implement some sort of scan region limiting.</p>
  
  <p>The use case is a pretty simple one: if I'm a user pointing my phone at a box with multiple barcodes of the same type (think shipping labels here), I want to explicitly point some little viewfinder or alignment straight-edge on the screen at exactly the thing I'm trying to capture, without having to worry about anything outside that area of interest giving me some scan results I don't want.</p>
  
  <p>The above case is handled in most other Android libraries I've seen, taking in either a Rect with relative or absolute coordinates, and this is also a part of iOS' AVCapture metadata results system (it uses a relative CGRect, but really the same concept).</p>
  
  <p>I've dug pretty deep into the sample app for the barcode-reader
  <a href="https://github.com/googlesamples/android-vision/tree/master/visionSamples/barcode-reader" rel="noreferrer">here</a>, but the implementation is a tad opaque to get anything but the high level implementation details down.</p>
  
  <p>It seems an ugly patch to, on successful detection of a barcode anywhere within the camera's preview frame, to simple no-op on barcodes outside of an area of interest, since the device is still working hard to compute those frames.</p>
  
  <p>Am I missing something very simple and obvious on this one? Any ideas on a way to implement this cleanly, otherwise?</p>
  
  <p>Many thanks for your time in reading through this!</p>