Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
I am relatively new to QT and am looking to build a graph digitizer which runs manually (User clicks positions on graph) and automatically. I have managed to get the manual side of the graph working but am looking to build the automatic side.
This involves clicking on the line graph line to say select colour and then have the program automatically give a vector of positions for the line which could be saved into .csv and used to recreate a digital version of the graph image. I am currently using a QImage to import the graph picture.
Any help would be well received
Hi and welcome to the forums
Since you have the manual part working click on the image and so on, what
part do you want help on ?
The math in the "automatically give a vector of position" or saving to
csv or where lies the dog ? ( not sure its the right expression :)
I need it to automatically detect the line and plot the points so instead of the user clicking several points on the line they instead click a couple and the program autofills the other points according to the line
Ok and are those lines straight or more like a spline / curve ?
if just a line then
but since you asked for help i assume its something more complicated ?
@mrjj They can be any 2D line graph splines, straight, lines curves
Ok. so we need the data these
2D line graph splines, straight, lines curves are based on if we are to calculate its
function based on a few points.
Can i see one images with the drawn curves you wish to calculate ?
Here is an example of the spline
You need to read math, I'm afraid. Rational B-splines, normal cubic splines or polyharmonic splines could work in your case, however I leave the wikipedia-ing to you. ;)
Is there no way to say track the colour of the spline and give pixel coordinates
Sorry, I don't understand the question. Please rephrase.
@kshegunov instead of using mathematics could you say click to select the colour of the line and then have the application give the coordinates of every pixel connected with that colour
If all images are as clean as this, you can easily scan to find the blue color and hence the Y coordinate.
or the faster way
But it wont be fast as such but unless
tiny mini board it should be fine:)
@mrjj thankyou for your help. Will this give an x coordinate aswell
Will this give an x coordinate aswell
Just iterate over all x coordinates and search for y like @mrjj suggested. Or iterate over y and get x...