Reputation: 41
I'd like to be able to detect small bright spots in a rectangular area (selected by dragging around a shape) in a NV21 preview byte array, sent to a PreviewCallback.
Main goal of this is to be able to detect whether someone's shining into the camera with a flashlight.
Any ideas? Thanks!
Upvotes: 1
Views: 92
Reputation: 57203
The first width*height bytes of NV21 are plain grayscale image, so you can feed them to any image processing algorithm with minimal effort.
One caveat you should be aware of, even if you hold the device in portrait orientation, and apply camera.setOrientation() to have the preview rotated properly, the preview buffer will still most likely be landscape, keep this in mind when you apply the coordinates received from computer vision.
Upvotes: 1