1

I'm getting the image of the format of yv12 with camera2 on real-time. I want to display this image in imageView. And also want to compare this image with drawable image. How can I do that. Thank you.

Surendar D
  • 5,554
  • 4
  • 36
  • 38
Ahsan Azwar
  • 328
  • 1
  • 5
  • 12

1 Answers1

1

There are different ways to convert camera preview frame to an image format that can be used for ImageView, see Android byte[] to image in Camera.onPreviewFrame. But none of the methods described there can help to produce live streaming UX. To achieve more than 15 FPS, you can use OpenGL surface instead of ImageView. Camera API supports direct feed to live texture.

The second part of your question is more vague. How do you compare two images? If you want to look for some similarity, you need advanced computer vision algorithms. It may be very hard to squeeze reliable image processing into fraction of a second.

Alex Cohn
  • 56,089
  • 9
  • 113
  • 307