Java blur Image

后端 未结 7 1842
臣服心动
臣服心动 2021-01-11 17:48

I am trying to blur the image

   int radius = 11;
    int size = radius * 2 + 1;
    float weight = 1.0f / (size * size);
    float[] data = new float[size *         


        
7条回答
  •  佛祖请我去吃肉
    2021-01-11 18:40

    If you frequently deal with pictures in your application, you may want to consider using the ImageJ API: It packs functionality on quite a lot of image processing tasks, including blurring.

    Their Gaussian Blur filter will blur right to the edge of the picture, by making the following assumption

    {...} it assumes that out-of-image pixels have a value equal to the nearest edge pixel {...}

    Even if you don't want to change your code to use the ImageJ API, you may still find the above assumption useful to solving your problem.

    For more info, check out the GaussianBlur filter in the API documentation: http://rsb.info.nih.gov/ij/developer/api/ij/plugin/filter/GaussianBlur.html

提交回复
热议问题