reverse engineering of graphs: reading data points from scatterplots maya wei
DESCRIPTION
Aim To develop a program that can accurately read data points from a graph.To develop a program that can accurately read data points from a graph. Would return: (1,1), (2,2), (3,3), (4,4), (5,5)TRANSCRIPT
Reverse Engineering of Reverse Engineering of Graphs: Reading Data Points Graphs: Reading Data Points
from Scatterplotsfrom Scatterplots
Maya WeiMaya Wei
Purpose?Purpose?Graphs are a visual Graphs are a visual method of displaying data.method of displaying data.
What happens if you no What happens if you no longer can find the original longer can find the original data, but are only left with data, but are only left with an image? an image?
Mathematical Mathematical manipulation in purely a manipulation in purely a visual representation is visual representation is highly slim.highly slim.
Forecasts Made During Solar StormsDay One
0
10
20
30
40
50
60
70
80
90
0 10 20 30 40 50 60 70 80 90 100
AimAim• To develop a program that can To develop a program that can
accurately read data points from a accurately read data points from a graph.graph.
Would return:Would return:(1,1), (2,2), (3,3), (4,4), (5,5)(1,1), (2,2), (3,3), (4,4), (5,5)
PrecedentsPrecedents• Image Analysis:Image Analysis:
– Edge DetectionEdge Detection– Shape DiscernmentShape Discernment
• Application of Basic TechniquesApplication of Basic Techniques
Graph, Graph, created in created in OpenOffice OpenOffice CalcCalc
Will identify Will identify edgesedges
Given that edges Given that edges identified, divide identified, divide edges into edges into number, axis, and number, axis, and pointpoint
DevelopmentDevelopment
Will show point in Will show point in relation to axesrelation to axesRadio Buttons are Love Radio Buttons are Love
<3<3
Timeline (Quarter 1)Timeline (Quarter 1)
Properly Display Properly Display Images / Read Images / Read Images in Images in PixelGrabber – 3 PixelGrabber – 3 WeeksWeeks
Change to Change to BufferedImage, create BufferedImage, create graphgraph
Graph modifications, Graph modifications, reading pixels, edge reading pixels, edge detectiondetection
GUI CreationGUI Creation
Timeline (Quarter 2)Timeline (Quarter 2)
GUI GUI modificationmodification
Identifying connected Identifying connected points, playing with data points, playing with data storage format – change storage format – change to to ArrayList<ArrayList<int[]ArrayList<ArrayList<int[]>>>>
Further GUI Further GUI modification, modification, addition of radio addition of radio buttonsbuttons
Identification – Identification – Axes, Points; Axes, Points; Axis Axis identification identification refinedrefined
Development and DisplayDevelopment and Display• Written in JavaWritten in Java• JPanelJPanel• BorderLayoutBorderLayout• JButtons in GridLayoutJButtons in GridLayout• Images in JLabel with ImageIconImages in JLabel with ImageIcon• JRadioButton \o/JRadioButton \o/
GraphGraph• PNG imagePNG image• BufferedImageBufferedImage
– Can manipulate pixels easilyCan manipulate pixels easily– Alternative PixelGrabberAlternative PixelGrabber
• Modifying images difficult hereModifying images difficult here• Background color same as point (0,0)Background color same as point (0,0)• No guidelinesNo guidelines• MinimalistMinimalist
Edge DetectionEdge Detection• Highly primitiveHighly primitive• Takes point, backgroundTakes point, background• Are the point’s surrounding colors Are the point’s surrounding colors
the same as the background colors?the same as the background colors?• If one yes, then it’s an edge.If one yes, then it’s an edge.
Edge Detection -- ProblemsEdge Detection -- Problems• Doesn’t take into account diagonalDoesn’t take into account diagonal• Based on assumption that Based on assumption that
background is same as (0, 0)background is same as (0, 0)• Assumption that colors are Assumption that colors are
consistent (not one shade off consistent (not one shade off background)background)
EdgesEdges
Orange are Orange are edges; edges; many many different different items items orangeorange
Connected PointsConnected Points• Using do-while loopUsing do-while loop• Searches through list of edge points Searches through list of edge points
to find the neighboring edge pointsto find the neighboring edge points• Adds onto arrayList, repeatsAdds onto arrayList, repeats• Primitive method, using anything Primitive method, using anything
advanced like iterators would cause advanced like iterators would cause an erroran error
IdentificationIdentification• AxesAxes
ExtendedExtended• Visual displayVisual display
Further WorkFurther Work• Identifying scale (fun stuff)Identifying scale (fun stuff)• Re-working GUIRe-working GUI
– Currently, “Extend” creates whole new Currently, “Extend” creates whole new image, work to get it to extend on image image, work to get it to extend on image already givenalready given
• Use of other graphsUse of other graphs
Learned?Learned?• Details have yet to be worked out, Details have yet to be worked out,
but the base is very much there. but the base is very much there. Scale will be the largest challenge.Scale will be the largest challenge.
• Forwards and onwards to the next Forwards and onwards to the next large adventure! (2large adventure! (2ndnd Quarter) Quarter)
Cheers!Cheers!
\o/\o/
<3<3