I have created a specialized image analysis method in Mathematica that takes an image and returns a marked up image with some detection output. In order to allow others to feed images into my analysis from arbitrary sources (databases, file systems, web interfaces, scanners, etc), I would like to wrap in a .NET application (preferably C#).
Is there any way to pass an image object from .NET into MathKernel via NETLink and handle it as an Image in the kernel? I have found examples of how to get images out of MathKernel, but not the other direction.
I could write the image to a temporary file, but that seems sloppy.
SocketListen
$\endgroup$PutByteArray(...)
of the image data, presumably NETLink supplies a similar hook toMLPutByteArray
? That will be fast and presumably pretty simple. UsePutType("Image", 1)
or whatever the correct call is (can't remember) to wrap the data inImage
first or whatever. I did this for my implementation of J/Link for python and remember it being pretty simple along those lines. $\endgroup$