Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

SLIC superpixel opencv c++

I have an android code and I want to translate it into c++ using openCV 3.2.0 (include the extra models), in my android app I used the SLIC superpixel from Ximgproc lib of opencv this is my code

applying the SLIC Superpixel
                    SuperpixelSLIC x = Ximgproc.createSuperpixelSLIC(newImage, Ximgproc.SLIC, 50, (float) 0.001);
                    x.iterate(20);
                    if (true) {
                        x.enforceLabelConnectivity(50);
                    }

                    mask = new Mat();
                    x.getLabelContourMask(mask, true);
                    newImage.setTo(new Scalar(0, 0, 255), mask);
                labels = new Mat();
                x.getLabels(labels);

                //count the number of the superpixel segmented regions
                /* int a = x.getNumberOfSuperpixels();*/

but I couldn't find how to apply the SLIC super pixel in c++( i'm using visual studio 2015). could someone help me ?! Note : I imported all the extra modules of the opencv contib.

SLIC superpixel opencv c++

I have an android code and I want to translate it into c++ using openCV 3.2.0 (include the extra models), in my android app I used the SLIC superpixel from Ximgproc lib of opencv this is my code

applying the SLIC Superpixel
                    SuperpixelSLIC x = Ximgproc.createSuperpixelSLIC(newImage, Ximgproc.SLIC, 50, (float) 0.001);
                    x.iterate(20);
                    if (true) {
                        x.enforceLabelConnectivity(50);
                    }

                    mask = new Mat();
                    x.getLabelContourMask(mask, true);
                    newImage.setTo(new Scalar(0, 0, 255), mask);
                labels = new Mat();
                x.getLabels(labels);

                //count the number of the superpixel segmented regions
                /* int a = x.getNumberOfSuperpixels();*/

but I couldn't find how to apply the SLIC super pixel in c++( i'm using visual studio 2015). could someone help me ?! Note : I imported all the extra modules of the opencv contib.

UPDATE 1 : i found this example of the using the SLIC Superpixel with opencv c++. But I couldn't undertand the type of the variable "seeds" visual studio tell me that "seeds" is not defined and i couldn't find the right type of this variable

SLIC superpixel opencv c++

I have an android code and I want to translate it into c++ using openCV 3.2.0 (include the extra models), in my android app I used the SLIC superpixel from Ximgproc lib of opencv this is my code

but I couldn't find how to apply the SLIC super pixel in c++( i'm using visual studio 2015). could someone help me ?! Note : I imported all the extra modules of the opencv contib.

UPDATE 1 : i found this example example of the using the SLIC Superpixel with opencv c++. But I couldn't undertand the type of the variable "seeds" visual studio tell me that "seeds" is not defined and i couldn't find the right type of this variable