180 likes | 192 Views
Develop a program to accurately read data points from a graph image, using edge detection and shape discernment techniques. The tool will identify edges, divide them into axes and points, and display the points in relation to the axes. Written in Java, the program utilizes JPanel with BorderLayout, JButtons in GridLayout, JLabel with ImageIcon for images, and JRadioButton. Challenges include handling diagonal edges and inconsistent background colors for edge detection.
E N D
Reverse Engineering of Graphs: Reading Data Points from Scatterplots Maya Wei
Purpose? Graphs are a visual method of displaying data. What happens if you no longer can find the original data, but are only left with an image? Mathematical manipulation in purely a visual representation is highly slim.
Aim • 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)
Precedents • Image Analysis: • Edge Detection • Shape Discernment • Application of Basic Techniques
Development Graph, created in OpenOffice Calc Will identify edges Given that edges identified, divide edges into number, axis, and point Will show point in relation to axes Radio Buttons are Love <3
Timeline (Quarter 1) Properly Display Images / Read Images in PixelGrabber – 3 Weeks Graph modifications, reading pixels, edge detection Change to BufferedImage, create graph GUI Creation
Timeline (Quarter 2) Further GUI modification, addition of radio buttons GUI modification Identification – Axes, Points; Axis identification refined Identifying connected points, playing with data storage format – change to ArrayList<ArrayList<int[]>>
Development and Display • Written in Java • JPanel • BorderLayout • JButtons in GridLayout • Images in JLabel with ImageIcon • JRadioButton \o/
Graph • PNG image • BufferedImage • Can manipulate pixels easily • Alternative PixelGrabber • Modifying images difficult here • Background color same as point (0,0) • No guidelines • Minimalist
Edge Detection • Highly primitive • Takes point, background • Are the point’s surrounding colors the same as the background colors? • If one yes, then it’s an edge.
Edge Detection -- Problems • Doesn’t take into account diagonal • Based on assumption that background is same as (0, 0) • Assumption that colors are consistent (not one shade off background)
Edges Orange are edges; many different items orange
Connected Points • Using do-while loop • Searches through list of edge points to find the neighboring edge points • Adds onto arrayList, repeats • Primitive method, using anything advanced like iterators would cause an error
Identification • Axes
Extended • Visual display
Further Work • Identifying scale (fun stuff) • Re-working GUI • Currently, “Extend” creates whole new image, work to get it to extend on image already given • Use of other graphs
Learned? • Details have yet to be worked out, but the base is very much there. Scale will be the largest challenge. • Forwards and onwards to the next large adventure! (2nd Quarter)
Cheers! <3 \o/