Hello Anh,
As you may know, LabVIEW MathScript is implemented on top of LabVIEW. The error message you received indicates that a problem occurred in one of the LabVIEW subVIs that MathScript calls. As Jim indicated, the problem is in the file type specifier you passed to the function. MathScript requires the use of 'JPEG' and not 'jpg' or even 'jpeg.' In this case, we could return a better error message. I have filed a bug report (115804) for this issue.
You will find that once you fix this, the im2double and rgb2gray functions are not supported. In LabVIEW MathScript, you generally can execute scripts written in the MATLAB® language syntax. However, the MathScript engine executes the scripts, and the MathScript engine does not support some functions that the MATLAB software supports.
We will look into adding these functions in a future release of LabVIEW MathScript. If you need this functionality now, these functions are very simple to write yourself. If you are performing additional image analysis in your script, you may wish to purchase the IMAQ toolkit. It doesn't add any functions to MathScript at this time, but you could continue your analysis outside of MathScript with LabVIEW VIs.
MATLAB® is a registered trademark of The MathWorks, Inc.
Grant M.
Staff Software Engineer | LabVIEW Math & Signal Processing | National Instruments