Tutorial 1: Convert Line Chart (colored solid lines)

This tutorial shows how to convert a line chart to data containing two colored solid lines. First start the Chart2Data App and select the Line / Scatter Chart icon. The tutorial is shown in expert mode (dark blue background). If you start Chart2Data for the first time the app is in Wizard mode by default (dark purple background). You can change the user mode in the App settings. Note: in case you change the user mode during a chart conversion process the new setting will be saved but will not be active since the user mode cannot be changed during a chart conversion process. The new setting will become active once you reach the start page again and choose a chart category.

The wizard mode is nearly identical with only a few settings that are not available. The settings unavailable in wizard mode will be pointed out.

Chart2Data_Screenshot_1

First open an Image by clicking / tapping on the large folder icon in the image area. You can find the image used for this tutorial in the downloads section. The filename of the image is:

colored_lineChart_with_magenta_grid.PNG

Note: using the small folder icon you can reload another image, in case you realize that you have opened the wrong image by mistake. Your screen should now look like this:

tutorial_1_1b

Now zoom into the lower left corner by using the two-fingered touch gesture or the Ctrl-Key plus mouse-wheel. Then click / tap the edit-box called Px. coord. y (lower left corner data area) to highlight it.

tutorial_1_2

Next click /tap the lower left corner of the data area in the chart (in this case it’s the origin of the chart) in order to transfer the pixel coordinates into the corresponding edit-boxes. Note: In case you would like to exactly reproduce the results of this tutorial, you have to make sure that you pick the same x- and y-coordinates as shown in this tutorial.

tutorial_1_2b

Then move navigate the pointer in the upper right corner of the data area of the chart and click / tap the edit-box called Px. coord. y (upper right corner data area) to highlight it.

tutorial_1_3

Next click /tap the upper right corner of the data area in the chart in order to transfer the pixel coordinates into the corresponding edit-boxes. Note: In case you would like to exactly reproduce the results of this tutorial, you have to make sure that you pick the same x- and y-coordinates as shown in this tutorial.

tutorial_1_3b

Let’s continue with setting the limits of the x- and y-scales. We start with lower limit value of the y-scale. Click / tap the edit box called y-Value (lower limit scale) and set it to “0” using the (Onscreen-)Keyboard.

tutorial_1_4

Note: for this chart we do not have to worry about the pixel coordinates of the lower y-scale limit (edit-box Px. coord. y (lower y-scale limit)) because this pixel coordinate coincides with the pixel coordinate of the lower left corner of the data area. This pixel coordinate needs only to be set if both pixel coordinates do not coincide (see figure below).

y_lowerPixel_edit_explain

Now we set the upper scale limit of the y-axis accordingly to “70”.

tutorial_1_5

We do the same with the lower and upper scale limits of the x-axis.

tutorial_1_6

tutorial_1_7

Now we want to remove the colored grid lines. Therefore we check the check-box Remove color.

tutorial_1_8

We leave the slider control Channel tolerance at its default value. The purpose of this control is to set a tolerance on the values of the red, green, and blue channels. This is necessary when converting jpg images, because in a jpg image (due to the compression algorithm) a curve that appears as homogenously colored to the naked eye, may have in fact slightly different values from pixel to pixel. This control is not available in Wizard-Mode.

To select the color to be removed, we zoom in on one grid line and select a pixel with the corresponding color. The selected color will show up in the white-rimmed circle. Note: Once you have selected a color the yellow marker of the label Selected color (grey = no color selected) will disappear. In case you want to select a different color you have to click / tap on the label or the circle showing the selected color in order to mark it again. Theses yellow markers (on edit-boxes or the color selector) tell the app how to process the pixel coordinates clicked / tapped on in the image.

tutorial_1_9

During selection of pixels defining the data area earlier in the process, we selected pixels in the center of the line marking the data area of the chart. Thus it is possible that there are still black pixels present in the selected data area. In order to get rid of these black pixels, we check Remove black.

tutorial_1_10

We leave the slider control Threshold ‘Black’ at its default value. The purpose for this control is the same as for the slider control Channel tolerance. In order to take in account slightly varying pixel values from pixel to pixel in jpg images, the Threshold value for pixels considered as ‘black’ can be adjusted. Every pixel value below this threshold (value 0 is pure black) is considered to be ‘black’. This control is also not available in Wizard-mode.

Since there are no grey pixels we want to have removed we leave Remove grey unchecked. We also leave the slider control Threshold ‘greyscale-conversion’ untouched. This control sets the value above which a pixel is considered ‘white’ (pixel value 255 is pure white). This comes in handy when converting bright colored curves like yellow for example. If this value is set too low, Chart2Data does recognize these pixels belonging to a curve. This control is not available in Wizard-Mode.

So we can preprocess the image by clicking / tapping on the Next button (arrow pointing to the right).

tutorial_1_11

The image preprocessing my take a while depending on your machine’s processor. On this second screen we do not need to do much, since we already set the correct scale limit values. The scaling of both axes is linear, so we leaving the scaling for both axes at “linear”. Now we choose Multiple curves (column scan).

tutorial_1_12

Note: the scan directions column scan (top to bottom) or row scan (left to right) are important. In this case column scan is the correct scan direction, since the chart is a regular mathematical function y = f(x). Meaning for this scan direction (top to bottom, blue arrows in figure below) each curve is detected only once at every position along the x-axis (see red dots in figure below). In row scan direction (green arrow) on the other hand the same curve would be detected several times (see green dots) resulting in more detected curves than actually present in the chart.

scan_direction_colScan

The row scan mode is needed for charts where x is a function of y: x = f(y). There are phenomena in nature where this comes in handy. For example we take a look at the temperature profile in the atmosphere, because the temperature is changing with increasing altitude.

temperature_profile

There is still one control left that we have not touched yet. It is the slider control called Remove smudge. This control defines an amount of pixels that will be treated as smudge and will no be detected as a curve pattern. Those small pattern can occur when scanning a chart from a hardcopy and there is dust on the scanner. Since the default value has proven to be sufficient, we leave it at that.

So now we are all set to convert our chart by clicking / tapping on the Next button. This may take a while (up to several minutes) depending on the amount of curve to be converted and the processor of your machine.

tutorial_1_12b

When the conversion process is finished, a screen appears prompting for a filename of the output file.

tutorial_1_13

After providing a filename for the output file, the Results Screen appears showing the values of the converted curves ( y1 and y2) in relation to the corresponding x values. As we remember the curves did not start at the x value of 0, so the first y values are set to NaN (not a number).

tutorial_1_14

 

When scrolling down to x = 1 we see values for y1 and y2. So now we are done!

tutorial_1_15