Is there any way of extracting raw data from scanned plots of charts with X and Y scales defined on graph paper?

6 次查看(过去 30 天)
I want to use scanned image of a chart with plotted data. If I define the X/Y scaling and limits, is there a way to extract plotted data points from the scanned image using MATLAB without having the raw data available?

采纳的回答

Walter Roberson
Walter Roberson 2018-5-1
I went through and tagged a number of contributions for this purpose last year. There might also have been some newer ones added after I did the sweep.

更多回答(3 个)

Thomas Gunther
Thomas Gunther 2018-5-1
I have attached a simple graph showing Tue Airspeed vs. Pressure Altitude and I want to be able to extract data from one of the Mach(M) Speed lines depicted.

Jeff Miller
Jeff Miller 2018-5-2
This is not inside MATLAB, but it might be helpful anyway: WebPlotDigitizer

James
James 2023-12-22
I know this is an old question, but for those who don't want to use the WebPlotDigitizer online resource, the following code does the same for a simple 2D X-Y plot (linear scale).
%% Get Image
cd('Path to directory containing the image')
image_data = imread('Path to image of figure');
imshow(image_data);
% Set the scale by selecting two points on the x-axis (small to large)
x_values = [min_x, max_x]; % Replace with the numerical values of the points you will select
disp('Click on point (min_x, 0.00)');
[x_pixel1, ~] = ginput(1); % Click on the pixel position for the minimum x-axis value
disp('Click on point (max_x, 0.00)');
[x_pixel2, ~] = ginput(1); % Click on the pixel position for the maximum x-axis value
% Now select two points on the y-axis (large to small this time)
y_values = [max_y, min_y]; % Replace with the numerical values of the points you will select
disp('Click on point (0.00, max_y)');
[~, y_pixel1] = ginput(1); % Click on the pixel position for the maximum y-axis value
disp('Click on point (0.00, min_y');
[~, y_pixel2] = ginput(1); % Click on the pixel position for the minimum y-axis value
%% Get Data
% Calculate scales for x and y axes
x_axis_scale = diff([x_values(1), x_values(2)]) / diff([x_pixel1, x_pixel2]);
y_axis_scale = diff([y_values(1), y_values(2)]) / diff([y_pixel2, y_pixel1]);
disp('Click on the curve to select points. Press Enter when finished.');
[x, y] = ginput; % Select points using mouse clicks
% Normalize the coordinates using the scale of the axes
x = (x - x_pixel1) * x_axis_scale + x_values(1);
y = (y_pixel1 - y) * y_axis_scale + y_values(1);

类别

Help CenterFile Exchange 中查找有关 Lighting, Transparency, and Shading 的更多信息

产品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by