12-25-2012 12:36 AM
Hello,
I am using mathscript node in my labview development. I have used right away "imfill" function to fill the holes in my edge detected image. But the "imfill" function is not working in mathscript.
How could I use this function in mathscript?
12-29-2012 06:29 PM
Did you take this code directly from MATLAB and put it in the MathScript node? (I'm guessing the imfill function is a MATLAB function?)
If so, you're going to be sorely dissapointed. While MATLAB and the MathScript node both use .m files, they are not the same language. The language is very similar, but the syntax differs slightly in some cases. My guess (since I've used MATLAB but never the imfill function) is that the imfill function is part of a toolkit for MATLAB. Unless the MathScript node has a corresponding function (you'd have to search the help to see) you will not be able to use this function in the MathScript node.
If the MathScript node has no corresponding function and you must use this function in LabVIEW, I would reccommend the MATLAB Script Node. This structure actually calls MATLAB through the ActiveX interface. This means that you must have MATLAB installed on the computer you are running your VI on.
12-30-2012 03:46 AM
Packersfan is correct. A general rule of thumb is that the functions that are core to MATLAB will work but not those contained in a toolbox (there are a couple of exceptions, the main one is that our control design and simulation module adds some functions).
I find the easiest wary to check is to open the math script window and type help function to see if it seems to know that function
12-30-2012 04:26 AM
In the title you say that all matlab functions are not working, but later you only mention one function (imfill) that is not working. Can you define the problem a bit better? What is working and what is not working? Thanks!
01-01-2013 09:38 PM
I have been working on color image segmentation in labVIEW. I did not find relevant VI's for this task in labVIEW. Thus, i choose mathscript node to write some procedure in accordance with MATLAB help from here http://www.mathworks.in/help/images/examples/detecting-a-cell-using-image-segmentation.html. Though, it is not for color segmentation as I said before but this was my initial step in writing into matscript. If you go through the link you would find the function "imfill" function, which is not allowed into mathscript in labVIEW. Thus, I raised this thread.
Thank you for your help.
01-01-2013 10:27 PM
I believe the functions you are looking for are in the NI Vision Module. There are tons of image processing VIs included in the module.
01-02-2013 12:24 AM
I have encountered this word "NI vision module" many times on this forums. What could be difference between normal "Vision and motion options in labVIEW" and "NI vision module"?
Is that any hardware along with special vision VI's or don't know?
01-02-2013 02:53 AM
That is the vision module that you have highlighted there so it appears you have it and so should have the functions you need contained within there.
The IMAQ and IMAQdx folders are those for capturing from hardware but there are also VIs to load images from file as well if this is what you need.