09-18-2015 07:02 AM
If only I knew...
I marked the blob coordinates (i.e. their center of mass) with yellow dots in the image to better illustrate that it clearly doesn't work. One would expect the fitted line to be tilted to the left, i.e. to be almost perfectly vertical.
09-18-2015 07:05 AM
Hi optimus,
it seems you zoomed in into your IMAQ image a lot…
With the coordinates you supplied in your last VI the blobs follow not a straight line, but rather a curve! The linear interpolation is correct (aka "quite ok") as said before - for the data you supplied before. Please show the full image in IMAQ - with the same range as is shown in my XY graph - for a fair comparison!
09-18-2015 07:15 AM
This is the complete image. It seems clear to me that the middle column fit doesn't work as well as the first and last column fits. Yes, the blobs form a (very slight) curve, but not nearly enough to justify the tilt of the center fit line. Or am I wrong?
09-18-2015 07:18 AM - edited 09-18-2015 07:19 AM
Hi optimus,
please attach a VI with exactly the coordinates as you have trouble with in your last message!
The ones you attached before seems to be very different to your current data set…
Also there is a small green dot in the center of your image. Where does it come from? What is its meaning?
09-18-2015 08:08 AM - edited 09-18-2015 08:10 AM
These are the coordinates I'm using. The image size is 1600x1200, the coordinates are measured from the top left corner (the origin).
For the VI I posted I just cut out the middle column and inserted it into a new black picture (also 1600x1200) using GIMP. So the coordinates should be absolutely the same.
I attached the complete VI with instructions in the code itself and the full blob picture I want to analyze.
I also included all needed subvis
09-18-2015 08:43 AM
Just to chip in, I can't open your vi:s from where I am now, but are you are trying to do a linear fit in cartesian coordinates, where y=m*x+t, to a vertical line? You will have problems defining m and t in that case.
09-18-2015 08:43 AM - edited 09-18-2015 08:44 AM
Hi optimus,
please check the attached VI.
I removed all the IMAQ parts as I don't have this module installed.
Your points aren't always on a nice line, just play around with the "columns" control!
And as Peeker pointed out: having a nearly vertical line doesn't play well with linear interpolation!
09-18-2015 10:57 AM
Maybe it would be better to transpose the data and fit for horizontal lines, then transform the result.
09-18-2015 11:47 AM - edited 09-18-2015 11:47 AM
But why is it working with the left column, then? That is a almost a perfect vertical line...
I'll try to transpose, though. How do I do that if I want both - horizontal and vertical fit lines in my blob image?
Btw thanks all for your input so far! 🙂
09-18-2015 12:11 PM