Take bar-code scanner apps on Android devices for example, most of the device screen is grayed-out leaving a small transparent portion toward the center. Once the bar-code falls completely inside of the transparent zone, the camera clicks the picture immediately. I imagine, the Camera.PreviewCallback is used to perform image recognition logic on the preview image, that is previewed onto the SurfaceView. What APIs are used to perform that logic? 1) Recognize the type of the picture, here a bar-code or a QR type image. 2) identify the corners of the recognized image and determine whether they are within the bounds of the transparent zone. 3) Any OCR (Optical Character Recognition) related content like reading some text content in the image etc etc...
I want to know how are those three requirements achieved, and what APIs best suit for them?