I want to pass an image file name as a parameter from C# to MATLAB. Here's what I have so far:
MATLAB code
function out = trial(im)
O = imread(im);
G = rgb2gray(O);
imwrite(G,'output','jpeg');
out = G;
C# code
private void btn_Browse_Click(object sender, EventArgs e)
{
openFileDialog1.ShowDialog();
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
pictureBox1.Image = new Bitmap(openFileDialog1.FileName);
}
}
When I browse and select an image file (openFileDialog1.FileName) I want to send it as the input parameter to the MATLAB function. How do I do this?