reference/ocr-new/prop.doc
author viric@llimona
Thu, 18 May 2006 23:12:51 +0200
changeset 0 6b8091ca909a
permissions -rw-r--r--
Init from working directory of svn repository.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
6b8091ca909a Init from working directory of svn repository.
viric@llimona
parents:
diff changeset
     1
6b8091ca909a Init from working directory of svn repository.
viric@llimona
parents:
diff changeset
     2
Here are my property and distance settings currently.  Property
6b8091ca909a Init from working directory of svn repository.
viric@llimona
parents:
diff changeset
     3
27 and 28 are weighted at 3. I am not sure why The disjoint property
6b8091ca909a Init from working directory of svn repository.
viric@llimona
parents:
diff changeset
     4
had to be so heavily weighted.  
6b8091ca909a Init from working directory of svn repository.
viric@llimona
parents:
diff changeset
     5
6b8091ca909a Init from working directory of svn repository.
viric@llimona
parents:
diff changeset
     6
6b8091ca909a Init from working directory of svn repository.
viric@llimona
parents:
diff changeset
     7
void Component::setProperties(BitMap * map)  // was BitMap
6b8091ca909a Init from working directory of svn repository.
viric@llimona
parents:
diff changeset
     8
/*--------------------------------------------------------------
6b8091ca909a Init from working directory of svn repository.
viric@llimona
parents:
diff changeset
     9
Primary Purpose: Set the property vector for this component
6b8091ca909a Init from working directory of svn repository.
viric@llimona
parents:
diff changeset
    10
Arguments:  The BitMap to which this component belongs
6b8091ca909a Init from working directory of svn repository.
viric@llimona
parents:
diff changeset
    11
Return Value:
6b8091ca909a Init from working directory of svn repository.
viric@llimona
parents:
diff changeset
    12
Effects: Property 0-24
6b8091ca909a Init from working directory of svn repository.
viric@llimona
parents:
diff changeset
    13
    The component is divided into a 5 by 5 grid.  A gray
6b8091ca909a Init from working directory of svn repository.
viric@llimona
parents:
diff changeset
    14
    scale (0 - 255) for each section is determined.  The gray scale
6b8091ca909a Init from working directory of svn repository.
viric@llimona
parents:
diff changeset
    15
    is 0 for all white, 255 for all black, but normally will be somewhere
6b8091ca909a Init from working directory of svn repository.
viric@llimona
parents:
diff changeset
    16
    between the two.  The gray scales are represented in properties
6b8091ca909a Init from working directory of svn repository.
viric@llimona
parents:
diff changeset
    17
    0-24. 
6b8091ca909a Init from working directory of svn repository.
viric@llimona
parents:
diff changeset
    18
    Property 25 is the grayscale accross the top.
6b8091ca909a Init from working directory of svn repository.
viric@llimona
parents:
diff changeset
    19
    Property 26 is the grayscale accross the bottom.
6b8091ca909a Init from working directory of svn repository.
viric@llimona
parents:
diff changeset
    20
    Property 27 is the width/height ratio again scaled to (0-255)
6b8091ca909a Init from working directory of svn repository.
viric@llimona
parents:
diff changeset
    21
    Actually the formula for property 27 is
6b8091ca909a Init from working directory of svn repository.
viric@llimona
parents:
diff changeset
    22
        width/ height * 255  if height > width
6b8091ca909a Init from working directory of svn repository.
viric@llimona
parents:
diff changeset
    23
        1- height/width * 255 if width > height
6b8091ca909a Init from working directory of svn repository.
viric@llimona
parents:
diff changeset
    24
    This way near 0 is very tall and thin
6b8091ca909a Init from working directory of svn repository.
viric@llimona
parents:
diff changeset
    25
             near 128 height near width
6b8091ca909a Init from working directory of svn repository.
viric@llimona
parents:
diff changeset
    26
	     near 255 very wide
6b8091ca909a Init from working directory of svn repository.
viric@llimona
parents:
diff changeset
    27
    Property 28 is  Indicator of a vertically disjoint character
6b8091ca909a Init from working directory of svn repository.
viric@llimona
parents:
diff changeset
    28
     like i and j. 0 - not disjoint. 255 - disjoint
6b8091ca909a Init from working directory of svn repository.
viric@llimona
parents:
diff changeset
    29
6b8091ca909a Init from working directory of svn repository.
viric@llimona
parents:
diff changeset
    30
6b8091ca909a Init from working directory of svn repository.
viric@llimona
parents:
diff changeset
    31
6b8091ca909a Init from working directory of svn repository.
viric@llimona
parents:
diff changeset
    32
6b8091ca909a Init from working directory of svn repository.
viric@llimona
parents:
diff changeset
    33
6b8091ca909a Init from working directory of svn repository.
viric@llimona
parents:
diff changeset
    34
Distance Component::distance(Component * comp) 
6b8091ca909a Init from working directory of svn repository.
viric@llimona
parents:
diff changeset
    35
/*--------------------------------------------------------------
6b8091ca909a Init from working directory of svn repository.
viric@llimona
parents:
diff changeset
    36
Primary Purpose: Determines heuristic distance between two components
6b8091ca909a Init from working directory of svn repository.
viric@llimona
parents:
diff changeset
    37
Arguments:  Another component to compare
6b8091ca909a Init from working directory of svn repository.
viric@llimona
parents:
diff changeset
    38
Return Value: integer value which represents the distance between two 
6b8091ca909a Init from working directory of svn repository.
viric@llimona
parents:
diff changeset
    39
   components. Distance = sum over i of
6b8091ca909a Init from working directory of svn repository.
viric@llimona
parents:
diff changeset
    40
                       weight *square (this->fproperty[i] - comp->fproperty[i])
6b8091ca909a Init from working directory of svn repository.
viric@llimona
parents:
diff changeset
    41
		       weight for i == 27, 28 is 3 weight is 1 for all other 
6b8091ca909a Init from working directory of svn repository.
viric@llimona
parents:
diff changeset
    42
		       properties
6b8091ca909a Init from working directory of svn repository.
viric@llimona
parents:
diff changeset
    43
6b8091ca909a Init from working directory of svn repository.
viric@llimona
parents:
diff changeset
    44
6b8091ca909a Init from working directory of svn repository.
viric@llimona
parents:
diff changeset
    45
6b8091ca909a Init from working directory of svn repository.
viric@llimona
parents:
diff changeset
    46
6b8091ca909a Init from working directory of svn repository.
viric@llimona
parents:
diff changeset
    47
6b8091ca909a Init from working directory of svn repository.
viric@llimona
parents:
diff changeset
    48
6b8091ca909a Init from working directory of svn repository.
viric@llimona
parents:
diff changeset
    49
6b8091ca909a Init from working directory of svn repository.
viric@llimona
parents:
diff changeset
    50