Gaussian blurring with OpenCV: only blurring a subregion of an image?

后端 未结 4 700
野的像风
野的像风 2020-12-15 22:49

Is it possible to only blur a subregion of an image, instead of the whole image with OpenCV, to save some computational cost?

EDIT: One important po

4条回答
  •  半阙折子戏
    2020-12-15 23:22

    If you are using javacv provided by bytecode

    then you can do like this way. It will only blur particular ROI.

    Mat src = imread("xyz.jpg",IMREAD_COLOR);
    Rect rect = new Rect(50,50,src.size().width()/3,100);
    GaussianBlur(new Mat(src, rect), new Mat(src, rect), new Size(23,23), 30);
    

提交回复
热议问题