LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Mathscript all matlab functions are not working

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?

0 Kudos
Message 1 of 8
(4,391 Views)

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.

Chris
Certified LabVIEW Architect
Certified TestStand Architect
0 Kudos
Message 2 of 8
(4,349 Views)

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

James Mc
========
CLA and cRIO Fanatic
My writings on LabVIEW Development are at devs.wiresmithtech.com
0 Kudos
Message 3 of 8
(4,341 Views)

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!

Message 4 of 8
(4,336 Views)

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.

0 Kudos
Message 5 of 8
(4,298 Views)

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.

Chris
Certified LabVIEW Architect
Certified TestStand Architect
0 Kudos
Message 6 of 8
(4,291 Views)

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?

0 Kudos
Message 7 of 8
(4,285 Views)

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.

James Mc
========
CLA and cRIO Fanatic
My writings on LabVIEW Development are at devs.wiresmithtech.com
0 Kudos
Message 8 of 8
(4,276 Views)