10-10-2018 04:58 PM - edited 10-10-2018 05:09 PM
Hello,
I am using a modified version of the MATLAB example Find Image Rotation and Scale:
to find the rotation and scale differences between two nearly identical images. I am getting entirely different results running the script in MATLAB versus the MATLAB script node in LabVIEW (see attached image). I am using LabVIEW 2017 64 bit, and MATLAB R2017a. The script requires the MATLAB Computer Vision System Toolbox.
It looks like the script and the script node are functioning the same until estimateGeometricTransform in line 51 of the code (see the MATLAB vs LabVIEW Feature Matching Lines Comparison.jpg image).
The only changes I have made to the attached Snippet and MATLAB .m file is to make the imread path in lines 10 and 11 of the code non-specific to my computer.
Thanks!
Solved! Go to Solution.
10-11-2018 03:46 AM
DISCLAMER: Not MATLAB expert.
Could MATLAB be using extended floats? LabVIEW uses doubles at the moment.
LabVIEW Programming ((make LV more popular, read this)
10-11-2018 02:32 PM
Their web page on Data Types says:
"By default, MATLAB® stores all numeric variables as double-precision floating-point values."
That being said, the scale_recovered and theta_recovered show as "1x1 singles" in the Workspace. I added the following code to the end of the program and it fixed the problem:
scale_recovered = double(scale_recovered);
theta_recovered = double(theta_recovered);
Thanks for your help!