opencv 膨胀和腐蚀操作

include

   //膨胀操作
    Mat kernel_dilate = getStructuringElement(MORPH_RECT,Size(2,1));
    dilate(dest_src,dest_src,kernel_dilate);

    //腐蚀操作
    Mat kernel_erode = getStructuringElement(MORPH_RECT,Size(2,1));
    erode(dest_src,dest_src,kernel_erode);

你可能感兴趣的:(opencv 膨胀和腐蚀操作)