我正在开发一个 Android 应用程序,它捕获图像然后使用 opencv 函数对其进行处理,然后返回结果图像并将其显示在图像视图中。如何临时保存捕获的图像以进行处理?
public class Camera extends Activity
{
ImageView imgview;
Bitmap Bmp;
final static int cameraData=0;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.camera);
imgview= (ImageView) findViewById(R.id.imgview);
Intent i=new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(i,cameraData);
}
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
// TODO Auto-generated method stub
super.onActivityResult(requestCode, resultCode, data);
if(resultCode == RESULT_OK)
{
Bundle extras=data.getExtras();
Bmp=(Bitmap)extras.get("data");
imgview.setImageBitmap(Bmp);
}
}
}