SuperpixelSlic image grainy

我的梦境 提交于 2020-01-05 07:24:16

问题


im doing an android project with opencv library and im using superpixelslic algorithm.After i applied the algorithm on some devices the image looks like grainy like this:

This is my superpixel code:

    newMat=new Mat();
    Utils.bitmapToMat(image,newMat,true);
    SuperpixelSLIC x= Ximgproc.createSuperpixelSLIC(newMat, Ximgproc.SLIC,rows/9,(float)25);
    x.iterate(num_iterations);
    if (min_element_size>0)
        x.enforceLabelConnectivity(min_element_size);
    Mat mask=new Mat();
    x.getLabelContourMask(mask,true);
    newMat.setTo( new Scalar(0,0,255),mask);
    Utils.matToBitmap(newMat,image);
    Mat labels=new Mat();
    x.getLabels(labels);
    final ImageView g=(ImageView)view.findViewById(R.id.imageView5);
    g.setImageBitmap(image);

Could it be that,after i take/choose a picture i cut e rotate it,loosing quality?

来源:https://stackoverflow.com/questions/45020247/superpixelslic-image-grainy

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