Borland c++ read value from graphic image

Hi guys

i have big problem
I must read the value from the graph. Do any have an idea?
ex. http://imagizer.imageshack.us/a/img922/8531/dmdZP9.jpg
what value?

to read the textual values, you need an OCR routine, which are error prone esp on funky fonts. You can train them to read it, but it may take some work.
To read the numeric value from an X/Y pair on one of the lines, you need to find that pixel, get its x,y location in the image and translate that to its x/y value from the graph's values, which should be easy if all the images are on the same scale, and difficult if not. With a multi-line graph, to isolate a line may be tricky also, you probably have to 'dither' around the pixels to be sure you count the lines correctly, and you will never be 100% sure that 2 lines were not on top of each other if that matters...
Last edited on
Do you need to support all of the curves or only 1?

Does the "reading" have to be completely automatic, or is user intervention allowed?

How much accuracy is required?

Can the curves be calculated, or are these empirically measured values?


Brute force: Take the scanned graph and put it into some sort of drawing program. Draw each of the grid lines on top of the image, and get the image coordinates of the endpoints of each line. Determine the translation required to map image coordinates to graph coordinates. (Note that the grid lines are not all perfectly straight, so there may be multiple translations depending on where you are in the image, depending on the accuracy you require.)

Next, draw each individual curve onto the image as a polyline. Get the image coordinates for each of the points in the polyline, and map them all to graph coordinates

When you need to read the graph, you will have an X coordinate and a specific curve to read. Find the 2 points on the appropriate polyline that bracket the X value, and interpolate to find the desired point on the curve. Use the interpolation to read the Y value.
Hello @Araknoid

What does the data represent?

The x-axis is definitely Froude number (velocity/sqrt(gravity x length) ), but I can't read what is on the y-axis: it looks like a hydraulic resistance coefficient (force / [1/2 density velocity2 x "area"]), where "area" is "volume"2/3). What quantity is constant on each curve?

If you can't find either the original data or a digitising tablet, then read a few points off each curve and spline fit them.
Last edited on
you have good eyes... if the slope of the entire image is consistent, you can correct for it linearly and easily. if it is crooked, you will have to work harder at it. Hopefully the slant is due to scanning it in crooked.

are you doing a bunch of these and this is 1 example, or is it just this chart? Re-creating it sounds good if its just the 1 chart.

Registered users can post here. Sign in or register to post.