embedded octave .m function in c++ code

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

embedded octave .m function in c++ code

LARTAUD PIERRE-JEAN p0900825
Hi everyone,

I’m a student in final year of engineering school, and I’m working on a program to count cells in a blood sample, using image processing. 
I’ve coded a self-made function ‘count.m’ which use a lot of different functions from the Image package of octave.
This function just takes the path of the image file as input, and gives the counts (number of red blood cells, white blood cells and thrombocytes) as output. 

Now, to connect my work to some other functions I’ve coded, I need to call my count.m function in C++.
The idea is to get the path of the image as a string, use my count.m function, and then get the counts back in C++.

I have already read a lot about standalone programs, here —> https://www.gnu.org/software/octave/doc/v4.0.3/Standalone-Programs.html#Standalone-Programs
I’ve been able to make the given (second one) example work without troubles, but I don’t understand how to fit it to my need.

Could anyone help me please ?

I’m running on Xubuntu 16.04 and Octave 4.0.0.
I’ve installed the octave dev package. 

Thanks a lot,

PJ Lartaud


_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: embedded octave .m function in c++ code

Carlo de Falco-2
Hi,

> On 4 Jan 2018, at 20:15, LARTAUD PIERRE-JEAN p0900825 <[hidden email]> wrote:
>
> I have already read a lot about standalone programs, here —> https://www.gnu.org/software/octave/doc/v4.0.3/Standalone-Programs.html#Standalone-Programs
> I’ve been able to make the given (second one) example work without troubles, but I don’t understand how to fit it to my need.

That example is essentially showing all you need to know on the Octave side so,
if there is something more related to your specific problem you want to ask for,
you need to make your question more specific.

What is the Octave function you want to call from C++, what input do you need to pass?
What output do you need to recieve? What have you tried already? What did not work?

But first, have you considered whether embedding the Octave interpreter is what
you really need? Have you considered having your C++ and Octave run as separate
processes exchanging data via files?

c.


_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave