Message Boards Message Boards

0
|
3856 Views
|
5 Replies
|
0 Total Likes
View groups...
Share
Share this post:

How to put options into functions

Posted 9 years ago

I want to use wolfram mathematica in C#. But I also don't undesrstand how I can cet parametres into wolfram. I need to write something like this. The result should be array, not an image. Can anybody help me to write this code in C# using wolfram? I want to get result of the listClust into C#

name = "29.jpg"
importString = "D:\\exp\\" <> name
file = Import["D:\\exp\\" <> name];(*open file*)
file = ColorConvert[file, "LAB"];
dataImage = ImageData[file];
listClust = ClusteringComponents[dataImage, 2, 2];
POSTED BY: Dmitry Dmitriev
5 Replies

I'm sorry. I don't understand your question.

Are you using .NETlink? http://reference.wolfram.com/language/NETLink/tutorial/Overview.html

Mathematica doesn't have any features for compiling into C#. You have to use .NETlink instead.

POSTED BY: Sean Clarke

I use .NET/Link User Guide. I need to compute this code:

listClust = ClusteringComponents[dataImage, 3, 2];

I imported files in C#. I want to conver image in C# to type ImageData, but I don't understand how can I do this. Also I should calculate desult if this code. I think that I should do something like this, bu I don't understand how can I write parametre's name:

        private void buttonBinarisation_Click(object sender, EventArgs e)
        {

            IKernelLink kl = MathLinkFactory.CreateKernelLink();
            object im = (object)pictureOriginal.Image;
            kl.Put(im);




        }

There is not many information in your description.http://reference.wolfram.com/language/NETLink/tutorial/Overview.html

POSTED BY: Dmitry Dmitriev

Please read through the documentation. You replied in 18 minutes of my post. That is not enough time to have read the documentation and try the basic examples there. Please try running the examples in the documentation so you can gain familiarity with the basics of how NETLink works.

To begin with, try using NETLink to do basic things like, computing "2+2" in Mathematica. Make sure you can compile and run these examples.

POSTED BY: Sean Clarke

i read documentation 2 days ago

POSTED BY: Dmitry Dmitriev

Are you able to run the basic examples there? Are you able to execute some simple code in Mathematica via NETLink? Please make sure that all the examples in the documentation are working for you first.

ImageData is not a type. It is just a function in Mathematica.

To keep things simple, convert the image into an array of floating point values or an array of integers. Use this array with NetLink. Once you pass the array in, the Mathematica code will have to turn the array into an image, do the necessary image processing and then convert it back to an array of floating point values or integers.

POSTED BY: Sean Clarke
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract