Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

SuperpixelSlic image grainy

Hi,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:

image description

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);