I want to down scale the captured image to 640x320 , convert it to greyscale and save it to sdcard. Do i need to work with byte[] data for conversion. I want to use the final output image for image matching. Here is my CameraVIew class
public class CameraView extends JavaCameraView implements PictureCallback {private static final String TAG = "CameraView";
private String mPictureFileName;
public CameraView(Context context) {
super(context, 0);
}
public void takePicture(final String fileName) {
Log.i(TAG, "Taking picture");
this.mPictureFileName = fileName;
mCamera.setPreviewCallback(null);
mCamera.takePicture(null, null, this);
}
@Override
public void onPictureTaken(byte[] data, Camera camera) {
Log.i(TAG, "Saving a bitmap to file");
mCamera.startPreview();
mCamera.setPreviewCallback(this);
try {
FileOutputStream fos = new FileOutputStream(mPictureFileName);
fos.write(data);
fos.close();
} catch (java.io.IOException e) {
Log.e(TAG, "Exception in photoCallback", e);
}
}
}