+ Post New Thread
Results 1 to 3 of 3
  1. #1
    Member level 4
    Points: 1,363, Level: 8

    Join Date
    Aug 2008
    Location
    Singapore
    Posts
    77
    Helped
    9 / 9
    Points
    1,363
    Level
    8

    Pattern Recognition(Matlab)

    Hi...

    I m new in image processing...

    want 2 recognize my specified pattern..

    I read an image with imread command,converted it into grayscale. then i have to use normxcorr2 function..

    how normxcorr2 function works?? what is template? and how it is used??


    thanks


    Naveed

    •   Alt13th December 2009, 11:27

      advertising

        
       

  2. #2
    Full Member level 2
    Points: 3,342, Level: 13
    Achievements:
    7 years registered
    s_cihan_tek's Avatar
    Join Date
    Mar 2006
    Location
    Turkey
    Posts
    126
    Helped
    64 / 64
    Points
    3,342
    Level
    13

    Re: Pattern Recognition(Matlab)

    Hi,

    Template is the pattern you want to find in the image. For example if you are looking for circles in an image, a smaller image containing only a circle is the template. Once you calculate the cross-correlation between a template T and an image I, you obtain an image X.

    The location of the pixel with the highest value in X will give you the location of the most similar pattern in I.

    In the link below, it is very clearly explained how to do cross-correlation and how to calculate the coordinates of the found pattern using the information returned from the function normxcorr2.

    http://www.mathworks.com/products/de...ion/imreg.html

    Regards.



    •   Alt13th December 2009, 13:08

      advertising

        
       

  3. #3
    Member level 4
    Points: 1,363, Level: 8

    Join Date
    Aug 2008
    Location
    Singapore
    Posts
    77
    Helped
    9 / 9
    Points
    1,363
    Level
    8

    Re: Pattern Recognition(Matlab)

    Thanks dear!


    I have the following code and steps

    1) I=imread('G:\test.bmp')
    2) rgb=rgb2gray(I)
    3) template=imcrop(rgb)
    4) cc= normxcorr2(template,rgb)

    Results.
    1)rgb matrix is 10x10 matrix, while template matrix is 6x5 matrix.
    2)cc returns me 15x14 matrix.

    How can i recognize the template or my specified pattern in rgb?? How should i read this 15x14 matrix??

    thanks alot

    Naveed



--[[ ]]--