MATLAB : How to find the line of best fit through a binary image?
Click For Summary
Discussion Overview
The discussion revolves around finding the line of best fit through a binary image derived from a 2D Fourier transform. Participants explore methods to achieve this, particularly focusing on the challenges posed by having multiple y values for each x value in the dataset.
Discussion Character
- Technical explanation, Debate/contested, Mathematical reasoning
Main Points Raised
- One participant seeks a method to find the line of best fit through the longest axis of a binary image.
- Another participant suggests using the polyfit() function in MATLAB for best fit lines, specifying the need for xdata and ydata vectors.
- A concern is raised about polyfit() requiring unique xdata points, as the current dataset has multiple y values for each x value.
- One participant proposes averaging repeated xdata points to create two vectors suitable for polyfit(), suggesting that this might yield reasonable results despite their lack of statistical expertise.
- Another participant mentions that linear regression can be used even when there are multiple y values for the same x value, and introduces the concept of principal component analysis as an alternative approach.
Areas of Agreement / Disagreement
Participants express differing views on the best approach to handle multiple y values for each x value, with some supporting the use of averaging and others advocating for linear regression or principal component analysis. No consensus is reached on a single method.
Contextual Notes
The discussion highlights the limitations of polyfit() in handling repeated xdata points and the potential need for data transformation before applying fitting methods. The effectiveness of averaging or using alternative methods like linear regression or principal component analysis remains uncertain.
Who May Find This Useful
Readers interested in MATLAB data analysis, statistical methods for fitting lines to data, and image processing techniques may find this discussion relevant.
Similar threads
- · Replies 12 ·
- · Replies 14 ·
- · Replies 15 ·
- · Replies 2 ·
- · Replies 5 ·
- · Replies 1 ·
- · Replies 2 ·
- · Replies 5 ·
- · Replies 1 ·
- · Replies 1 ·