OpenCV4Android - Blank Image After Using MorphologyEX

江枫思渺然 提交于 2019-12-13 06:13:53

问题


So I'm attempting to get a BlackHat Morph of an image but after applying the Morph operation I'm getting a Blank image and I'm not sure why.

private coid convertToBlackHat( Mat passedImage )
    {
        // Create a structuring element (SE)
    int morph_size = 2;
    Mat element = Imgproc.getStructuringElement( Imgproc.MORPH_RECT, new Size( 2*morph_size + 1, 2*morph_size+1 ), new Point( morph_size, morph_size ) );

    Mat dst = new Mat(); // result matrix
    // Apply the specified morphology operation
    Imgproc.morphologyEx( passedImage, dst, MORPH_TOPHAT, element, Point(-1,-1));   


    mBlackhatOutput = dst.clone();
}

The image is a 24-Bit jpeg at 1920x1080 with 100px circles on it.

来源:https://stackoverflow.com/questions/31272327/opencv4android-blank-image-after-using-morphologyex

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!