By: Haroon Iqbal & Zhongdi Guo

------------------------------------------------------------------------------------

Thursday, 7 March 2013

Overview of the Project

As you can see above the topic is "Determination of the image of an object" and topic itself is telling us what you are suppose to do. We took a sample image and there were two circle type objects in it as you can see the image below in Figure 1,which were very near to eachother and the image was in RGB(Red Green Blue) or colourful state quality in which you can't see the outlines of the circles because in the image there were some cracks and the objects were made of glass. Shining was also a big problem.So, in solution of these problems we changed the RGB image to YUV intensity image(Black & White) as it was easier to deal with the image in this quality.

                                                            (Figure 1)

After converting it into YUV intensity the next task was to find out the radius and centre of both the objects, first by removing one of the object from the image and vice versa. We were unable to find out the edge of the objects still even you converted it to YUV intensity. For that purpose, we then added Gaussian noise through which we could see the edge of the objects a bit clear than before. Moving forward, we used filter and implemented convolution to see edge more clearer. At last, we used Sobel Operator in codes to detect the edge to the best form.
Now the next task was to find the circles for both objects, as we were interested to find out the center and radius of the objects, for that purpose we used Hough Transformation so that we can have the circles for both the objects so that we may get the center and radius of the circles.After implementing Hough's transformation we took approximately five close values both from the x-axis and y-axis and averaged them out for having the best possible center value.After getting the values we can now easily gap region length between both the objects and that's what we were supposed to do.

Sunday, 3 March 2013

Details of the Project-3

After we got the edge image, we found the edge of two patterns is similar with circle arc. Accordingly, we try to use Hough Transformation to detect circles:
  • First we create our accumulator space which is made up of a cell for each pixel, initially each of these will be set to 0.
  • For each(edge point in image(i, j)): Increment all cells which according to the equation of a circle( (i-a)² + (j-b)² = r² ) could be the center of a circle, these cells are represented by the letter 'a' in the equation.
  • For all possible value of a found in the previous step, find all possible values of b which satisfy the equation.
  • Search for the local maxima cells, these are any cells whose value is greater than every other cell in it's neighbourhood. These cells are the one with the highest probability of being the location of the circle(s) we are trying to locate.
  • The result we got finally is shown as following, where the step of radius=10, the step of angles=0.1, the minimum radius=650, the maximum radius=750, the threshold value=0.4.

    When the step of radius=10, the step of angles=0.1, the minimum radius=1390, the maximum radius=1400, the threshold value=0.3, we got


    We selected some groups of data from all the data we got, according to the centres and radius, we drew 8 circles, then used curve fitting to create a new circles based on the 8 circles we drew. Next, we can get a circle which is much more closed to the edges of two patterns. The print shot is shown below, where the location of the centre is (xc,yc), the radius is R.

    After we got the circles above, we can get the equations of those two circles. Finally, we draw them in the original images to check whether they fits the edges of two patterns.
    The result we got is great, we can use the equation of two circles to calculate the coordinate value of arbitrary point on the circle, and obtain the distance between them.

    Details of the Project-1

    After changing the RGB image into a YUV image, we try to continue the simplification in order to get a binary image. We attempt to find the threshold value in 4 method.

    1.    I used 4 methods to make the original image binary, shown as following:

    average intensity value, we calculate the average threshold value equals to 0.517. The binary image is as following:

    The result is not good because there are many interferential parts around the edge of two patterns.

    Otsu method is to calculate the between-class variance of image to binarize an image. The binarized image is shown as following:

    Otsu method is used widely to binarize an image.But for our project, it is not good enough because we want a binary image which contains two patterns but Otsu method can only show one.

    KittlerMet method.

    Bad results are ignored.






    Saturday, 2 March 2013

    Complete explanation of the Project

    As in the overview section it is mention over there too that we took a sample image and there were two circle type objects in it as you can see the image below in Figure 1.1,which were very near to eachother and the image was in RGB(Red Green Blue) or colourful state quality in which you can't see the outlines of the circles because in the image there were some cracks and the objects were made of glass. Shining was also a big problem.So, in solution of these problems we changed the RGB image to YUV intensity image(Black & White) as it was easier to deal with the image in this quality.

                                                                      (Figure 1.1)

    When we convert RGB form to YUV intensity image we get an image in black & white quality basically you can see that in Figure 1.2.
                                                                      (Figure 1.2)
    Still YUV image was not good enough and we couldn't get the edges clearly. Then for the next step we changed the image to the binary format and we could only identify the edges one by one.Firstly, for the first object and then for the second.We used many methods to convert the format of the image to binary.
    The very first method we used was OTSU method which is used for the reduction of a graylevel image to a binary image and we were working to sort out first for one object and then we could repeat the same method again for the second object.You can see the result we got after implementing the OTSU method in Figure 1.3.
                                                                      (Figure 1.3)
    This method does the same job what we were required to do but doesn't do that much in our case.So we moved further and then we tried "Global threshold method" in which we got the average threshold value equal to 0.517 and its result can be seen below in Figure 1.4.
                                                                     (Figure 1.4)
    As you can see that there are some interferential parts around the edge of two patterns so this method was also not working for us.

    Friday, 1 March 2013

    Details of the project-2

    The fourth method is to use “imadjust function” to adjust contrast radio of the image. The next step is adding Gaussian noise and adding filter to noise reduction. Finally, using “Sobel operator” to measure the edge of the pattern.
    1.    Setting the lower input=0.57, higher input=0.6, output is [0 1]. The four pictures in the second figure is produced by three different filtering windows(3x3, 5x5, 7x7). The result is :


    2.    Setting the lower input=0.27, higher input=0.35, output is [0 1]. The result is:


    The objective of adjusting contrast radio is to make the one of wanted patterns get more clear; the processing of adding noise and denoising can dim the interferential areas; "Sobel operator" can detect the edge of the parttern. After the procedure above, we can get clear edges of two patterns.