Why do I get different results from MATLAB vs a MATLAB script node in LabVIEW?
Show older comments
Hello,
I am using a modified version of the MATLAB example Find Image Rotation and Scale:
http://www.mathworks.com/help/images/find-image-rotation-and-scale.html;jsessionid=f361fc9c69eae8406...
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!
5 Comments
dpb
on 10 Oct 2018
"getting entirely different results running the script in MATLAB versus the MATLAB script node in LabVIEW (see attached image)."
What, specifically? My eyes are old, so maybe that's the problem but I can't pick out anything obviously that different.
dpb
on 11 Oct 2018
[Ben Answer moved to Comment -- dpb]
The two results that I am interested in are the scale_recovered and theta_recovered:
MATLAB
scale_recovered = 1.0006
theta_recovered = 0.0035
LabVIEW
scale_recovered = 5.26 E-315
theta_recovered = 4.92 E-315
dpb
on 11 Oct 2018
That looks like a problem in interpretation of data type vis a vis in an interface routine I'm guessing...like double passed as single, maybe??
Ben Thiesing
on 11 Oct 2018
Edited: Ben Thiesing
on 11 Oct 2018
dpb
on 11 Oct 2018
Well, it was a conjecture, but the really funky exponent when the graphs looked like the routine worked almost had to be something of the sort...the pay's the same whether is an Answer and accepted or not; the feedback that it helped is the reward!
Answers (0)
Categories
Find more on LabVIEW in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!