简体   繁体   中英

Plot points over image in Octave/Matlab

A project I'm working on has an 'old-school' subject matter expert. He has provided me with important plots on XY axes. The plots are hand drawn, but very carefully made. I need a way to get the decimal values of each point into a file. Once I have this, I'll use an interpolation function from matlab or octave.

My first option is to just eyeball the plots and guess at the values of each point and type them into Excel or something. I really don't want to do this.

In Matlab and Octave, I understand there is a function called ginput with which the user can click on points in the plane to plot them. This is getting closer to what I want to do.

To ensure the best accuracy, I would like to have the original plot from the SME underneath ginput, like as a background image. I would make the ginput axes as close to the hand drawn ones as possible and then just click on the points in the original image to plot them.

Is there a way to do this with Octave/Matlab? Maybe another tool?

I've done this before with octave when I had to digitize spectral response from sensors from scanned datasheets.

img = imread ('datasheet.png');
imshow(img)
[X, Y, BUTTONS] = ginput ();

I then clicked the 4 corners to calculate the scale and the position of ther origo and then as much datapoints as I want. When I'm finished I press RETURN and have the values in X, Y which I calculate back to the desired units.

engauge is a great tool for that. The manual, an the tutorials are all under the help menu.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM