Connecting matlab and visual studio

15 views (last 30 days)
aravind`
aravind` on 13 Mar 2012
Can we connect visual studio and matlab ? if so how ? can anyone please help me ?
  2 Comments
Jason Ross
Jason Ross on 13 Mar 2012
What do you mean by "connect"? What are you trying to do?
aravind`
aravind` on 14 Mar 2012
Sir, i have created a webpage in visual studio. Which has a button,it will get images from the user. I need to compare this image with image in the Database. I am doing this comparison using matlab. So i need to connect visual studio and Matlab.

Sign in to comment.

Accepted Answer

Geoff
Geoff on 14 Mar 2012
If this is to be deployed on a server somewhere, it might get a little fiddly.
However, if you simply have MatLab and VS running on your local machine (and I assume the web page is 'running' in VS as some kind of .Net app), you might want to consider this:
Create a directory that the web app drops files.
Set up a MatLab timer to regularly scan that directory for new images (let's just say once every second).
When you find an image, load it and do the comparison.
To communicate back to the web app, you can write out a text file with the same base name as the image and put whatever information you want in there. The web app could wait to receive this file before timing out.
Finally, MatLab either deletes the image file or moves it out of the way.
If you are deploying on a server, you won't be using Visual Studio, but the principle is pretty much the same. However, you will have compiled your MatLab application into an EXE using one of the rather expensive toolkits.
At this point you might want to question whether using a powerful tool like MatLab for basic image comparison (I read your other question on the comparison) is a good idea, when something like ImageMagick will do what you want. In fact, you can do an image comparison in Php, entirely removing the need to outsource the task to another process.
-g-

More Answers (2)

Mike Woodward
Mike Woodward on 26 Jun 2012

aravind`
aravind` on 15 Mar 2012
Thank you for your response Sir, i am doing it without using any server..i.e Matlab and VS is running on my machine. Can you elaborate about it ? I am new to matlab so i am not able to understand.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!