SLIC superpixel opencv c++

asked 2018-11-15 06:51:09 -0500

manef gravatar image

updated 2018-11-17 05:50:48 -0500

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

edit retag flag offensive close merge delete


what is the exact problem, now ?

berak gravatar imageberak ( 2018-11-15 07:06:14 -0500 )edit

use the sample here (instead of backporting your android code)

berak gravatar imageberak ( 2018-11-15 07:08:50 -0500 )edit

@break i couldn't apply the function SuperpixelSLIC x = Ximgproc.createSuperpixelSLIC. i need to find the exact syntaxe so i could use it i hope to find someone how used her before or have an idea

manef gravatar imagemanef ( 2018-11-15 08:05:25 -0500 )edit

i really don't understand the problem here. the java code is working fine, the mentioned c++ sample, too.

i couldn't apply the function

what does that even mean ? be more concise !

java (as a language) ofc. is NOT c++, so again, you shouldnot try to translate it line by line, literally, but rather look at the c++ code.

berak gravatar imageberak ( 2018-11-16 01:21:06 -0500 )edit

sorry if you couldn't understand me. In my app i want to use the opencv, the SLIC exist in the opencv this is the documentation documentation i used the same function from the opencv with java but i couldn't use it c++.,I found this exemple and i need to find the type of the variable seeds = createSuperpixelSLIC(h1) if you could help please

manef gravatar imagemanef ( 2018-11-16 02:21:30 -0500 )edit

this has 6 comments already, yet you never explain why you can't use it

  • edit your question
  • throw out the java code
  • put in the c++ code you're trying with
  • add any error you get
berak gravatar imageberak ( 2018-11-16 02:36:44 -0500 )edit

i update the question hope you could help

manef gravatar imagemanef ( 2018-11-17 05:51:30 -0500 )edit

no, it doesn't. linking to another SO question is kinda useless to explain your problem.


berak gravatar imageberak ( 2018-11-17 05:56:58 -0500 )edit

thanks it working that's what i'm looking for : Ptr<superpixelslic> slic = createSuperpixelSLIC(converted,algorithm+SLIC,region_size,float(ruler));

manef gravatar imagemanef ( 2018-11-17 06:17:44 -0500 )edit

it was already in the 2nd comment. you never looked.

berak gravatar imageberak ( 2018-11-17 06:22:15 -0500 )edit