is there a way to draw a best fit graph from a cut off circle, i have the [x y] coordinates for the first black points. now i want to use these coordinates to draw the exact shape on a graph. i tried polyfit but it doesnt give me the required shape
this seems to work but why is it that when i remove the line imshow, the graph switches on the y axis. Also, why did you have [y,x] = find(~I) ; instead of [x,y]?
this is how i tried to do it but i get a figure like this. my code is below. the imgThresh is the image converted to binary
why did you have [y,x] = find(~I) ; instead of [x,y]?
If you have a table of data, such as a logarithm table
then would find data by referring to "row 7, column 3" -- vertical distance named first, and then horizontal distance named.
This is the order that MATLAB uses for arrays. The first index is vertical distance, and the second index is horizontal distance.
However, the convention for Cartesian coordinates is that the independent variable, x, is along the vertical axes and is named first, followed by the dependent variable on the vertical axes second.
Row is vertical distance. Vertical distance is y. Therefore, row coordinates correspond to y, and column coordinates correspond to x.
why is it that when i remove the line imshow, the graph switches on the y axis.
imshow() does an automatic
set(gca,'Ydir','reverse')
unless hold is on for the axes. When you are dealing with images, it is very common to think of them in terms of distance down from the top, instead of in terms of distance up from the bottom (Cartesian coordinates.)
this is the code i used to get the center, it works for other test images but for this. the output does not give me a tangent across the blue line. does your code pasted earlier have a way of getting the center of the ellipse?
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.