How get coordinates of specific points (i.e turning points) in Matlab - matlab

I have a set of (X, Y) coordinates which, when plotted produce a graph as in the pictures below. What I am trying to do, is to find the coordinates of the areas (corner points) circled in red.
I have been trying to find ways to accomplish this, as those actual turning points represents my area of interest. Please note that I do not have the actual equation for those coordinates.
I would find it grateful if someone could please advise me, or give me some directions on how to go about this, either by using Matlab, or even some other ideas using some C++ tools.

I manage to solve this using a combinaison of the Point Cloud Library and Matlab. The former helped me to separate the coordinates in line segments (RANSAC) and using the latter, I was able to get the Equation of each line segments (Curve Fitting), and simply compute the intersection point through some basic math calculation.

Related

Find the other end of a curve after a cut in an image

I would like to follow a curve (with matlab or opencv) and to find the other end of it when it is cut by an empty space like this example, which is simplified to illustrate the problem:
Link to image of cut curve
Real images are more like this one: Link to real image to analyse
To follow the curve, I can use a skeleton and look at the neighbourhood. The problem is that I don't know how to find the other end efficiently.
I don't think that closing or opening operations could help because as shown on the previous image, there are other curves and the two parts of the curve are quite far from each other so it could lead to boundaries between the different curves instead of the two parts.
I was thinking about polynomial evaluation which could be a solution for simple curves but I am not sure about the precision I could get. If I use a skeleton, I have to find exactly the right pixel or to search in a reasonable neighbourhood which would take some time and once again, as there are other curves in the images, I have to be sure that I will find the good one.
That's why I am searching for an existing function which could estimate precisely the trajectory of the curve and give an usefull output to go further and find the second part of the curve.
If that kind of function doesn't exist, I'm open to any other way of analysing the problem if it can help.
I will start to explain with the first image you provided, you can implement common OpenCV function useful for detecting contour(black region in your case as you have binary image) known as cv2.findContours(), which returns the coordinates of the edges of the surface detected then you can plot each detected contour separately in a blank image to get the edge of your desired line.
Now coming to your 2nd image you have to be slightly careful while performing above analysis as there are many tiny lines. get back to me for further help

Getting a cross-section from power-spectrum

I am currently trying to use spectral-methods to analyse topographic landscapes.
When i FFT the landscape and plot the power-spectrum. From the power-spectrum an orientation of the structures in the landscape can be found.
2D power-spectrum:-
In this power-spectrum, i would like to make a cross-section.
This is easy when the peak amplitude orientation is along the x or y-axis.
But for this area (and others), this is not the case.
Cross-section from another area - orientated along the y-axis:-
My problem is i want to make a cross-section along the peaks in 1, and i just cant seem to figure it out how.
If anyone could point me towards some solution for this. Been stuck here for a couple of days now.
Edit 1
I would like the cross-section, to be a line along the peak orientation.
Edit 2
Improved the first image to show where i want my cross-section
My solution was, as GameOfThrows suggested:
Pick 2 (or more) points on the orientation i want
used Least squares on the points to create the line
Setup a meshgrid for the interpolation.
Use the interp2 function on the new line.
define a proper axis for the section
In my final cross section i ended up having multiple lines in it, that way i was sure to hit the max amplitudes.
i was a little with the answer to my question, but i have been busy :)
You can use ginput built-in matlab function to store 2 (x,y) coordinates of your power spectrum and then use this values to delimit a profile to be interpolated.

List of point into smooth curve (airfoil shape)

I have a list of 200 points I garnered from a graph digitization software I would like to transform into a smooth curve and then into Solidworks.
My points form an ellipse (airfoil shape to be more precise), so the commands I've tried in Matlab didn't have a circular curve.
My issues are:
* Obtaining a smooth curve that doesn't necessarily pass through all points, smooth being motus operandi.
* Being able to have a elliptical curve
* Somehow being able to export this curve into Solidwords
If anyone knows the right software, command line or anything that could get me started, I would be extremely thankful.
imacube
I've used Solid Works before. It's a very powerful tool. There should be some way to draw a curved spline through these points, such as a cubic spline.
If you are using a standard(ish) airfoil, then you can use a variety of tools to plot the points without having to use a graph digitization software.
Javafoil, for instance, is one of those. Even if you know the characteristics of your airfoil, you can use this to give you a smooth set of points.
Again, if your airfoil is a naca 4-series, then these are governed by a set of equations.
But I take it that the airfoil you want a more complicated one. Let me know if I can help anymore.

Colouring specific points in a MATLAB surface plot

I have a 3 dimensional data set which I intend to analyse. After analysing the data set, basically running an algorithm to find a range of points, I this range of points to have a specific colour so that when someone sees the surface plot, they know which are the points of interest. How can this be achieved?
I have tried to find some help in the mathworks forums, but so far I am not able to find a satisfactory solution.
If you are using the surface function, you can use the 4 parameter version surf(x,y,z,c) where c lets you specify colour based on the currently used colour map. See this link at the mathworks site for more detail http://www.mathworks.co.uk/help/matlab/ref/surf.html

[MATLAB]: How would I mathematically and visually reproduce the 3D surface of the new King's Cross 'Western Concourse'?

Anyone have any starting tips for me? I want to learn from this (ie Don't want to be lazy and have someone answer this for me).
I would like to develop my understanding of mathematical 3D surfaces. My own personal project is to produce a 3D surface/graph of the concourse structure in MATLAB.
I found a link with good pictures of its geometry here. I am not expecting to get it 100% perfectly but I'd like to come close!
At the end of this exercise I would like to have a mathematical definition of the geometry as well as a visual representation of the surface. This can involve cartesian equations, parametric equations, matrices, etc.
Any help would be very much appreciated!
To give some specific advice for MATLAB:
I would load in the 'section' image from the web page you have linked, and display this in a MATLAB figure window. You can then try plotting lines over the top until you find one that fits nicely. So you might do something like:
A = imread('~/Desktop/1314019872-1244-n364-1000x707.jpg');
imshow(A)
hold on
axis on
%# my guess at the function - obviously not a good fit
x = [550:900];
plot(x, 0.0001*x.^2 + 300)
Of course, you might want to move the position of the origin or crop the picture and so on.
As an arguably better alternative to this trial-and-error method, you could trace the outline of the section (e.g by clicking points with something like ginput), and then use one of MATLAB's curve-fitting tools (e.g. fit) to fit a function to the data.
The final 3D shape looks to me (at a casual glance) to be a 3D revolution of the section shape around a central axis. Use of a cylindrical coordinate system could therefore be a good idea.
The final plotting of your 3D shape could be done with a function such as surf or mesh.
I would start by defining a function that defines for each x, y coordinate whether there is a point z, and if so with which altitude.
The shape reminds me a bit of a log or a square root.