11-16-2006
05:34 PM
- last edited on
09-28-2025
08:27 PM
by
Content Cleaner
Good day,
I am working on an image recognition application and moved recently to LabVIEW for a good real-time performance ( hopefully ). One problem that I have faced is as follows,
I am using cameras, and I need to get the real world coordinates for the snaps that am getting ( i.e. to calibrate my camera ). I already did that on MATLAB where i was working before using a " cook book " procedure that ends up with calling a dll file that converts a 2D coordinates to a 3D world coordinates. Now, I need to do the same in LabVIEW.
I read NI's "Can LabVIEW C?" , but I couldn't use the same procedure for using that dll .. the inputs for my dll are three, the calibration results file name, two points represent the 2D image coordinates. The outputs are apparently three, the three coordinates of the real world.
My output parameters are not the same as my inputs so how can I define that ? I am getting the outputs same as the inputs!
In MATLAB, i used to write
[x,y,z]=ic2wc('calres.txt',100,50);
Any suggestions ? Do you think it would applicable to use a MATLAB function instead and then reach it from a math script ( oh , am I going really far ? ) ..
I know that LabVIEW has its vision VIs for calibration, but am happy with that accuracy delivered from that recipe,
I attach my files.
Any inputs are much appreciated,
Moh
11-19-2006 12:28 AM
11-20-2006 04:48 AM
11-20-2006
07:31 AM
- last edited on
09-28-2025
08:29 PM
by
Content Cleaner
11-23-2006 12:37 PM
Hi Hannah,
That Math Script is very useless and obsolete, or at least let's not relate it with MATLAB. It can just run the very simple examples. I have many single m-files that should be simple but Mathscript is finding syntax errors in them!
Labview crashes almost every time I try to connect a DLL. I've been browsing the links you provided and others I got via search, users obviously are facing much trouble in anything related with DLL.
a quick note for some more R&D would be appreciated 😉
Thanks for your time.
moh
11-23-2006 12:52 PM
11-23-2006 02:03 PM
11-24-2006
04:21 AM
- last edited on
09-28-2025
08:29 PM
by
Content Cleaner
11-24-2006 09:31 AM
Many thanks Hannah,
the MATLAB script node is fine now after replacing matscript.dll.
About accessing the DLL,
I got it that I can't access DLL from MATLAB directly and I have to create dll wrappers in C. I could reach two approaches but unfortunately none works so far.
The first one is using MATLAB's C shared library which says that the MATLAB Compiler generates a wrapper file, a header file, and an export list to be used by other applications. The attached archive has the original m file with the library after compilation and a VI that shows the trial. It gives the same error every time.
The other approach is creating the wrapper file myself using MSVC 2003. I tried to follow the steps as in this post (dllexample.zip) . I am finding difficulty in writing the wrapping function. In that example ( adding two matrices ) , the idea is to change the dimension of the matrices to 1 instead of two and then get them into the function, that should be a special case for a purpose, no? can't I get a 2D array into my function? in that example , to create the input data, it is defined:
in1=mxCreateDoubleMatrix (m,n,mxREAL);
I wanna forget about the m and n and get my matrix directly in. Please if you have a link to somewhere where they talk about data types related, let me know.
the other thing, about the library function, for example mlf* , how can I know it's inputs? it's different than the original function since it is of kind VOID.
It sounds a bit complicated, but I think it's doable,
any suggestions?
thanks,
moh