tags:

views:

646

answers:

2

I am using letter_regcog example from OpenCV, it used dataset from UCI which have structure like this:

Attribute Information:
     1. lettr capital letter (26 values from A to Z)
     2. x-box horizontal position of box (integer)
     3. y-box vertical position of box (integer)
     4. width width of box   (integer)
     5. high  height of box   (integer)
     6. onpix total # on pixels  (integer)
     7. x-bar mean x of on pixels in box (integer)
     8. y-bar mean y of on pixels in box (integer)
     9. x2bar mean x variance   (integer)
    10. y2bar mean y variance   (integer)
    11. xybar mean x y correlation  (integer)
    12. x2ybr mean of x * x * y  (integer)
    13. xy2br mean of x * y * y  (integer)
    14. x-ege mean edge count left to right (integer)
    15. xegvy correlation of x-ege with y (integer)
    16. y-ege mean edge count bottom to top (integer)
    17. yegvx correlation of y-ege with x (integer)

example:

T,2,8,3,5,1,8,13,0,6,6,10,8,0,8,0,8
I,5,12,3,7,2,10,5,5,4,13,3,9,2,8,4,10

now I have segmented image of letter and want to transform it into data like this to put recognize it but I don't understand the mean of all value like "6. onpix total # on pixels" what is it mean ? Can you please explain the mean of these value. thanks.

+1  A: 

I am not familiar with OpenCV's letter_recog example, but this appears to be a feature vector, or set of statistics about the image of a letter that is used to classify the future occurrences of the letter. The results of your segmentation should leave you with a binary mask with 1's on the letter and 0's everywhere else. onpix is simply the total count of pixels that fall on the letter, or in other words, the sum of your binary mask.

Most of the rest values in the list need to be calculated based on the set of pixels with a value of 1 in your binary mask. x and y are just the position of the pixel. For instance, x-bar is just the sample mean of all of the x positions of all pixels that have a 1 in the mask. You should be able to easily find references on the web for mathematical definitions of mean, variance, covariance and correlation.

14-17 are a little different since they are based on edge pixels, but the calculations should be similar, just over a different set of pixels.

Jason
+1  A: 

Hi, My name is Antonio Bernal. In page 3 of this article you will find a good description for each value. Letter Recognition Using Holland-Style Adaptive Classifiers. If you have any doubt let me know. I am trying to make this algorithm work, but my problem is that I do not know how to scale the values to fit them to the range 0-15. Do you have any idea how to do this?