Click here to load reader

Android based application for graph analysis final report

Embed Size (px)

Citation preview

Slide 1

By Pallab SarkarReg no :-122504060Master of Science in Technology - Computer SciencesProject Start Date: 05/06/2013

Android based application for graph analysis

IntroductionIn this project we want to develop a graph analysis tool which will,Provide easy and intuitive mechanism to get values at any point in the graph.Effectively leverages capabilities of both Image processing concepts and high end smart phones .Also try to contribute back to the open source community in this process.2

Problem Definition

3Myriad of graphical representation are their to represent data of various nature. The major problem is to analyze this graphical representation without hassle and with ease.

4

Coordinates at this point ?Values at this point ?

5One Solution Android Graph Reader

Methodology6

7

OpenCV 8For all the Image Processing needs we have used OpenCV library android port OpenCV4Android.This is open source library which implements lots of image processing algorithms for direct use.OpenCV4Android has a modular structure, which means that the package includes several java libraries to use.Like org.opencv.core, org.opencv.imgproc, org.opencv.video, org.opencv.calib3d, org.opencv.features2d, org.opencv.objdetect, org.opencv.highgui, org.opencv.android

9

Procedural Design10

Controller Module

11This drives whole application based on user input.It maintains the state machine for application.Below is the UI part which will be interacting with the Controller module

12public boolean onCreateOptionsMenu(Menu menu) { Log.i(TAG, "called onCreateOptionsMenu"); mItemReset = menu.add("Reset"); mItemPreProcess = menu.add("Pre Process"); mItemPostProcess = menu.add("Post Process"); mItemLoadFile = menu.add("Load File"); return true; }

public boolean onOptionsItemSelected(MenuItem item) {

Log.i(TAG, "called onOptionsItemSelected; selected item: " + item); if (item == mItemReset)//Perform corresponding state changes and procedure calls else if (item == mItemPreProcess)//Perform corresponding state changes and procedure calls else if(item == mItemPostProcess)//Perform corresponding state changes and procedure calls else if(item == mItemLoadFile)//Perform corresponding state changes and procedure calls return true; }

PreProc Module

13Performs all the pre processing on the input imageColor conversion from RGB to GrayscaleHistogram equalizationApplying Gaussian blurPerforming Canny edge detectionFinding contours

14Final pre processed out put image.

15Imgproc.cvtColor(mRgba, mRgba, Imgproc.COLOR_RGB2GRAY, 0);Imgproc.equalizeHist(mRgba, mRgba); Size s = new Size(7,7);Imgproc.GaussianBlur(mRgba, mRgba, s, 1.5, 1.5);Imgproc.Canny(mRgba, mRgba, 80, 90); List contours = new ArrayList();Imgproc.findContours(mRgba, contours, mHierarchy, Imgproc.RETR_EXTERNAL, Imgproc.CHAIN_APPROX_SIMPLE);Imgproc.drawContours(mRgba, contours, -1, CONTOUR_COLOR);

PostProc Module

16Perform feature extraction on imageGenerates the values so that it can be used for calculation,Identify the type of graph

17To indentify the number marking on the axis and corresponding pixel value at that point this will be use to interpolate values later on.

CordCalc Module

18Uses the data stored in the post process module and calculate the requested coordinates values.

Now suppose from origin (0,0) to (5,0) total pixels are 25 then1pixel on X axis = 5/25Similarly from (0, 0) to (0, 4) total pixel are 30 then1 pixel on Y axis = 4/30.If the point of interest is at (a, b) pixel location then actual location on graph is(5a/25, 4b/30).

19

What is the value at this point? In 2D grayscale image we have two found out the coordinate same as linear graph i.e the (x,y) values and also the Z also at that point from the color bar legend

We have to match the average color value of the point (x,y) area and need to match the closet point in the color bar legend. Then interpolate that Z value to find accurate Z a value. That is how we can find (x,y,z) coordinate for 2 D grayscale image.

Discussion of Result20Below is the UI sequence of operation in the application to found out the coordinate at any point in graph by user touches on the desired point

User clicks preprocess21

Post process with result pop up22

Conclusion23This project demonstrates the power of Image processing in general and OpenCV in particular. Image processing, machine learning and computer vision are the one frontier area of research and development.Android as an OS is very powerful tool of innovation and gives a handy platform for development of this type of application.

In the future works I am planning to make it more vivid and improve the UI .We can add some more feature like Premark all the points on the graph and when user hover over it he can view the coordinate values.We can also add some type of database like mySQl, to store all theses coordinate and user is provided with an API to extract all the values on one click.

Reference24http://opencv.org/http://sourceforge.net/projects/digitizer/http://www.imagemagick.org/Magick++/http://getdata-graph-digitizer.com/features.phphttp://homepages.inf.ed.ac.uk/rbf/HIPR2/hough.htmhttp://docs.opencv.org/opencv_tutorials.pdfhttp://dcs.opencv.org/opencv2refman.pdfhttp://dcs.opencv.org/opencv_user.pdfhttp://dcs.opencv.org/opencv2manager.pdfhttp://www.cuelogic.com/blog/opencv-contour-detection-in-android-2/[Canny86] 10. Canny. A Computational Approach to Edge Detection, IEEE Trans. on Pattern Analysis and Machine Intelligence, 8(6), pp. 679-698 (1986).[Suzuki85] Suzuki, S. and Abe, K., Topological Structural Analysis of Digitized Binary Images by Border Following. CVGIP 30 1, pp 32-46 (1985)

Thanks25