Seeking help in Octave C++ API

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Seeking help in Octave C++ API

Siddhartha
Hi Sir/Madam,
                      I am trying to call the octave function "imregionalmax" in a C++ code. I have seen that, how to call "gcd" using fevel(). In that same way I am trying to call imregionalmax function but I am unable to do that. Can anyone please help me how to call "imregionalmax" function from a C++ code using Octave API. I am using ubuntu 18.04 and the version of octave is 4.2.2.
Please provide a demo code if possible which will work.
Your response will be highly appreciated.
Thanking You.

with regards,
Siddhartha Roy
Associate Software Engineer
Vehere Interactive Pvt. Ltd.
Reply | Threaded
Open this post in threaded view
|

Re: Seeking help in Octave C++ API

Carnë Draug
On Thu, 1 Apr 2021 at 16:26, Siddhartha Roy <[hidden email]> wrote:

> Hi Sir/Madam,
>
> I am trying to call the octave function
> "imregionalmax" in a C++ code. I have seen that, how to call "gcd"
> using fevel(). In that same way I am trying to call imregionalmax
> function but I am unable to do that. Can anyone please help me how
> to call "imregionalmax" function from a C++ code using Octave API. I
> am using ubuntu 18.04 and the version of octave is 4.2.2.
>
> Please provide a demo code if possible which will work.
> Your response will be highly appreciated.
> Thanking You.
>
> with regards,
> Siddhartha Roy
> Associate Software Engineer
> Vehere Interactive Pvt. Ltd.

Hi Sidhartha

Note that while it's doable to call Octave functions in a C++ program,
that will make your program dependent on the Octave libraries.  This
means that your program will bound by Octave's GPL.

I'm pointing this out because Anurag Shivam Prasad, also from Vehere,
has recently contacted me about a C++ implementation of imregionalmax.
One of the requirements was that it wouldn't be dependent on Octave so
that it could later be commercialised.  The route you're trying, i.e.,
using Octave's C++ API, will not work if that goal remains.

Best regards
David

Reply | Threaded
Open this post in threaded view
|

Re: Seeking help in Octave C++ API

Siddhartha
Hi Carnë,
Thanks for your response. I want to make use of the octave function and I want to call it from my C++ code. I know my code will then depend upon octave libraries but it doesn't matter. I recently went through the link "https://octave.sourceforge.io/coda/c58.html" and I saw the example of C++ code  of matpow function. In the same way I want to call imregionalmax function. But I found out that this function is a part of image package of octave. So I downloaded image-2.12.0 and inside that folder I found out a c++ file imreconstruct.cc & imreconstruct function is used in the implementation of imregionalmax in octave. So, now, if I can call imreconstruct like matpow function in c++ code (using octave library) then I can also build imregionalmax function.
So, please help me in calling the imreconstruct function from C++ code using octave API or imregionalmax function directly. It will be very helpful for me if you provide a demo C++ code.
Thanking you.
Your response will be highly appreciated.

with regards,
Siddhartha Roy
Associate Software Engineer
Vehere Interactive Pvt. Ltd.


On Thu, Apr 1, 2021 at 9:20 PM Carnë Draug <[hidden email]> wrote:
On Thu, 1 Apr 2021 at 16:26, Siddhartha Roy <[hidden email]> wrote:
> Hi Sir/Madam,
>
> I am trying to call the octave function
> "imregionalmax" in a C++ code. I have seen that, how to call "gcd"
> using fevel(). In that same way I am trying to call imregionalmax
> function but I am unable to do that. Can anyone please help me how
> to call "imregionalmax" function from a C++ code using Octave API. I
> am using ubuntu 18.04 and the version of octave is 4.2.2.
>
> Please provide a demo code if possible which will work.
> Your response will be highly appreciated.
> Thanking You.
>
> with regards,
> Siddhartha Roy
> Associate Software Engineer
> Vehere Interactive Pvt. Ltd.

Hi Sidhartha

Note that while it's doable to call Octave functions in a C++ program,
that will make your program dependent on the Octave libraries.  This
means that your program will bound by Octave's GPL.

I'm pointing this out because Anurag Shivam Prasad, also from Vehere,
has recently contacted me about a C++ implementation of imregionalmax.
One of the requirements was that it wouldn't be dependent on Octave so
that it could later be commercialised.  The route you're trying, i.e.,
using Octave's C++ API, will not work if that goal remains.

Best regards
David
Reply | Threaded
Open this post in threaded view
|

Re: Seeking help in Octave C++ API

Carlo de Falco-2


> Il giorno 2 apr 2021, alle ore 11:44, Siddhartha Roy <[hidden email]> ha scritto:
>
>  I recently went through the link "https://octave.sourceforge.io/coda/c58.html" and I saw the example of C++ code  of matpow function
I think this document is decades old, more up-to-date info can be found here :
https://octave.org/doc/v6.2.0/Oct_002dFiles.html#Oct_002dFiles

c.
Reply | Threaded
Open this post in threaded view
|

Re: Seeking help in Octave C++ API

Siddhartha
Hi,
I have gone through that link. But unfortunately I am still unable to find the solution to calling imreconstruct function from a C++ code(my code may depend on the octave compiler but not depend on the octave script i.e. .m file).
Please help me in this matter.
with regards,
Siddhartha Roy
Associate Software Engineer
Vehere Interactive Pvt. Ltd.


On Fri, Apr 2, 2021 at 7:34 PM Carlo De Falco <[hidden email]> wrote:


> Il giorno 2 apr 2021, alle ore 11:44, Siddhartha Roy <[hidden email]> ha scritto:
>
>  I recently went through the link "https://octave.sourceforge.io/coda/c58.html" and I saw the example of C++ code  of matpow function
I think this document is decades old, more up-to-date info can be found here :
https://octave.org/doc/v6.2.0/Oct_002dFiles.html#Oct_002dFiles

c.
Reply | Threaded
Open this post in threaded view
|

Re: Seeking help in Octave C++ API

Carlo de Falco-2


> Il giorno 5 apr 2021, alle ore 11:28, Emil M. Oanta <[hidden email]> ha scritto:
>
> Hello Carlo,
>
> You may find here the solutions studied by me:
> https://iopscience.iop.org/article/10.1088/1757-899X/591/1/012061/pdf
>
> Regards,
>
> Emil

Dear Emil,

Your paper seems to provide examples for embedding Octave 4.2.x in C++ applications,
but the API has changed since then and the examples in the manual that I linked to are
more up-to-date.

On the other hand, form the abstract, it seems that broader topic of your paper is about
building complex applications by patching together pieces of custom c++ code, Octave libraries
and commercial CAD applications.

An important topic when discussing this subject would be to clarify the legal aspects,
as anything that links to Octave libraries qualifies as "derived work" of Octave and should
therefore be released under the GNU GPL v3 license.

I think it would make sense to clarify how you expect software built with the approach you
propose to comply with the above requirement of the Octave license ...

c.



Reply | Threaded
Open this post in threaded view
|

Re: Seeking help in Octave C++ API

Siddhartha
In reply to this post by Siddhartha
Hi,
I have installed image package but I don't know how to load the package while using C++. I mean I know how to load it in octave (by running "pkg load image") but I don't know how to load it while using C++.
"imreconstruct" is a function from the image package : this means to use imreconstruct or imregionalmax , we first need to load the image package in octave.
So, what I am telling is that to load image package in octave we need to run the command "pkg load image". but (i) what will be the equivalent way to load the image package in C++ in order to call imreconstruct or imregionalmax in C++.
& then (ii) what will be the way to call imreconstruct or imregionalmax in C++.
with regards,
Siddhartha Roy
Associate Software Engineer
Vehere Interactive Pvt. Ltd.


On Mon, Apr 5, 2021 at 2:05 PM Carlo De Falco <[hidden email]> wrote:


> Il giorno 5 apr 2021, alle ore 09:06, Siddhartha Roy <[hidden email]> ha scritto:
>
> Hi,
> I have gone through that link. But unfortunately I am still unable to find the solution to calling imreconstruct function from a C++ code(my code may depend on the octave compiler but not depend on the octave script i.e. .m file).
> Please help me in this matter.
> with regards,
> Siddhartha Roy


I am not sure what you mean here ...

"imreconstruct" is a function from the image package,
to use it in your code you need the image package to be
installed and loaded and then you can invoke it the "interp.feval"
as shown in the manual.

BTW, I believe this discussion is better suited for the
help mailing list/discourse channel so please continue the thread there.

HTH,
c.