加载服用时间很多Android的图像效果? [英] Loading image Effects taking Lot of time in Android?
问题描述
我是新来的Android。我根据我在哪里有超过40种不同的效果,如深褐色,浮雕编辑任何单个图像的图像处理工作的一个项目,雕刻等。现在的问题是whenver我使用任何高resoution的高清图像需要花费大量的时间ATLEAST 15分钟来加载图像上的所有影响。如何减少这个时间,我没有使用OpenCV的API。下面是我的code .....
I am new to Android . I am working on a project based on image processing where i am editing any single image with more than 40 different effects such as sepia,Emboss,engrave etc. Now the problem is whenver i use any high resoution HD image it takes a lot of time atleast 15 mins to load all the effects on that image . how to reduce this time and I am not using OpenCV API. Below is my code.....
public class Image_add_effects extends Activity implements OnClickListener{
ImageView image;
HorizontalScrollView view;
ImageView mSwitcher;
ArrayList<Bitmap>array_image;
Bitmap image_compress;
BitmapDrawable drawable,drawable_image;
Bitmap changed_image;
Gallery g;
ImageView img1,img2,img3,img4,img5;
Bitmap bit1,bit2,bit3,bit4,bit5;
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.add_effects);
setBodyUi();
System.loadLibrary("PhotoProcessing");
changed_image=Image_effects.image_change;
ByteArrayOutputStream stream = new ByteArrayOutputStream();
//System.out.println("yourSelectedImage"+yourSelectedImage);
changed_image.compress(Bitmap.CompressFormat.JPEG, 100, stream);
new SendImage().execute();
}
public class SendImage extends AsyncTask<String, Process, String> {
ProgressDialog pb;
String the_string_response;
String image_str;
@Override
public void onPreExecute() {
pb = ProgressDialog
.show(Image_add_effects.this, null, "Processing....");
}
@Override
protected String doInBackground(String... params) {
bit1=(Effects_change.doInvert(image_compress));
bit2=(Effects_change.doHighlightImage(image_compress));
bit3=(Effects_change.applyGaussianBlur(image_compress));
bit4=(Effects_change.sharpen((image_compress),20));
bit5=(Effects_change.applyMeanRemoval(image_compress));
bit6=(Effects_change.smooth((image_compress),8));
bit7=(Effects_change.emboss(image_compress));
bit8=(Effects_change.engrave(image_compress));
bit9=(Effects_change.applyHueFilter((image_compress),9));
bit10=(Effects_change.doGreyscale(image_compress));
bit11=(Effects_change.doGamma((image_compress),0.6, 0.6, 0.6));
bit12=(Effects_change.doGamma((image_compress),1.8, 1.8, 1.8));
bit13=(Effects_change.doColorFilter((image_compress), 1.0, 0, 0));
bit14=(Effects_change.doColorFilter((image_compress), 0, 1, 0));
bit15=(Effects_change.doColorFilter((image_compress), 0, 0, 1));
bit16=(Effects_change.doColorFilter((image_compress), 0.5, 0.5, 0.5));
bit17=(Effects_change.doColorFilter((image_compress), 1.5, 1.5, 1.5));
bit18=(Effects_change.createSepiaToningEffect((image_compress),100, 1.5, 0.6, 0.12));
bit19=(Effects_change.createSepiaToningEffect((image_compress),200, 0.88, 2.45, 1.43));
bit20=(Effects_change.createSepiaToningEffect((image_compress),255, 1.2, 0.87, 2.1));
return null;
}
@Override
public void onPostExecute(String result) {
super.onPostExecute(result);
img1.setImageBitmap(bit1);
img2.setImageBitmap(bit2);
img3.setImageBitmap(bit3);
img4.setImageBitmap(bit4);
img5.setImageBitmap(bit5);
pb.dismiss();
}
}
我使用这个链接上面code: -
的http://xjaphx.word$p$pss.com/2011/06/21/image-processing-grayscale-image-on-the-fly/
由于我做一个Android应用程序,因为我是新来的影像处理它让我很难做same.IF任何一个能提供我一个链接,它的演示或可以解释我如何添加效果的图像那么这将是对我帮助很大....
As I am making an Android application,SInce I am new to Image Processing its getting difficult for me to do the same.IF any one can provide me a link for its demo or can explain me how to Add Effects to an Images then it would be of great help to me....
谢谢andvance
Thanks in andvance
推荐答案
Try to use Catalano Framework. And this is the article explaning how to use.
这篇关于加载服用时间很多Android的图像效果?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!