Crosspost from StackOverflow:
http://stackoverflow.com/questions/8649751/ways-of-getting-high-fps-for-real-time-computer-vision-processing

My goal is to get as high FPS as possible. I will be happy with BW
small frames, but FPS should be maximum. getSupportedPreviewFpsRange
on HTC WildFire S returns (9, 30). But when I try to draw preview
image with most simple processing it visually get at about 12-15 FPS
max. After setting Parameters and startPreview() method call I do
this:

camera.setPreviewCallback(new Camera.PreviewCallback() {
          @Override
          public void onPreviewFrame(byte[] bytes, Camera camera) {
            Bitmap bitmap = Bitmap.createBitmap(size.width,
size.height, Bitmap.Config.ARGB_8888);
            int[] colors = new int[size.width * size.height];
            for (int i=0; i < colors.length; i++){
              colors[i] = getBWColor(bytes[i]);
            }
            bitmap.setPixels(colors, 0, size.width, 0, 0, size.width,
size.height);
            secondView.setImageBitmap(bitmap);
          }
        });
      }

private static int getBWColor(byte b){
    int res = 255;
    for(int i=0;i<3;i++){
      res = (res << 8) + b;
    }
    return res;
  }
Is there way to get it as fast as possible? =(

I looked everywhere, but still can't find the solution. I seems that I
need to work with media recorder streams, as someone suggested. But
How exactly ... ?

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to