0

I am using Android Camera2 sample to display and capture pre-processed images. However, I am not being able to do both tasks with the same ImageReader.OnImageAvailableListener. When onImageAvailable(ImageReader reader) is called for capturing, it can not read the image. I followed @AngeloS answer here.

Even if I think that I can work around this, I am not sure if this is the best way to accomplish my end goal. Basically, I want to convert the image to grayscale, do some more preprocessing steps, and extract keypoints from the image using ORB/SIFT/SURF. I want the user to see the preview with preprocessing steps and be able to press capture when he wants. After that, I will extract keypoints from the saved image. I know that processing and displaying in a Texture will be slow, but I think it is feasible.

Summary: is this a good approach? Is it feasible? If yes, is there a way to solve this (capture after preprocessed display)? If you think I am lost, teach me :)

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
jcpaiva
  • 422
  • 1
  • 6
  • 14
  • I'm using Renderscript now to preprocess the image. It works nicely and it is fast, but I'm still not able to capture a picture. – jcpaiva Nov 28 '17 at 17:29
  • Solved it. I will post the solution after presenting my work. Basically, I have created 2 `PreProcessor` instances, one that is only used in capture mode and another that is used in preview mode. `Prepocessor` applies the pre-processing to every frames that it receives in an input Allocation and writes the result in an output Allocation. I will provide a github link next week. – jcpaiva Nov 28 '17 at 20:15

0 Answers0