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