Sunday, 2 March 2014

Final version of the GUI system

During five weeks' working, the final graphical user interface (GUI) was finished. The functionality required to achieve of the program is accomplished. The users can utilise the system to load the data and figures from external files, research the data loaded by the different functions and do the curve fitting of the information stored in the system.

Figure 1 The final graphical user interface


As Figure 1 shown, it is the window of GUI to execute all the operations. First of all, the Input part allows the data and figure to be loaded in the GUI program.
Figure 2 The data load

Next, the Coordinate settings can accomplish some functions for researching the data loaded such as identifying the data from the axes, whilst the Data analysis part can achieve the curve fitting of the data.

Figure 3 Identify the data from the axes


 
Figure 4 Curve fitting of the original data


Moreover, the results of all the operations can display on the two axes and the Prompt window can show the manipulation of current process.
Figure 5 Prompt window show the details of current operation

Image processing

The project is about the applications of matlab GUI on the image processing. It is important to process the image and get the each point on the figure. Here are some  technics which will have some help with that to get  more accurate values.

The biggest problem is that how to find or track the line you want and withdraw the points on that line. For example, there is a figure:



In this figure, the line we want is in blue. But, there are some words or black lines which will influence reading points. In this case, it is vital to cut the figure which we need and wipe out the grid.

First, cut the figure by using ginput function to find the original points and end of x-aix and y-aix:


Then, cut the figure by these three points and get :


By this figure,  only curve and grid left, next step is to clean the grid. We find that the color of line and grid is different. One is deep and another is light. So, change the figure to binary will fix it:


Now, we can read the each point by finding the 0 in every pixels and store it into an array.

However, there are some cases that the grid is not   easily cleared by binary image. 

case 1:  when there are some single points in the figure.

some colors of grids are not different to much with curve especially at cross points. Here is a example:


after processing:


It is clear show that some single points are left on the figure. In this case, we will need the a function to clean it. The method is to find each point equal to 0 and check whether the area around it is all 0. If yes, this point will be 1 which is white.



Then, the single points is cleared.

case 2:  grids line is in the same color with curve

In this case, it is hard to distinguish with curve we want. See the figure below:


As usual, cut the figure firstly.



Though the figure is in black and white, it is also a gray image. We need to change it to binary image.


Now, the chart is in binary. However, it is hard to divide grid and curve. We use a function to check the each row and column that whether the numbers of 0 in row and column is take place more than 10% of whole pixels on that line. This is the result.



By this function, the grid will be cleared.