Skip to content

Commit

Permalink
add an API call to remove all points from the glyphDetector
Browse files Browse the repository at this point in the history
  • Loading branch information
britg committed Aug 19, 2011
1 parent 6ed430c commit 311cee6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions WTMGlyph.xcodeproj/project.pbxproj
Expand Up @@ -356,6 +356,7 @@
EA6C92ED136DA457008AD709 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0420;
ORGANIZATIONNAME = "Warrior Thief Mage Studios";
};
buildConfigurationList = EA6C92F0136DA457008AD709 /* Build configuration list for PBXProject "WTMGlyph" */;
Expand Down
1 change: 1 addition & 0 deletions WTMGlyph/WTMGlyphDetector.h
Expand Up @@ -39,6 +39,7 @@
- (void)removeGlyphByName:(NSString *)name;

- (void)addPoint:(CGPoint)point;
- (void)removeAllPoints;
- (void)detectGlyph;
- (NSArray *)resample:(NSArray *)_points;
- (NSArray *)translate:(NSArray *)_points;
Expand Down
6 changes: 5 additions & 1 deletion WTMGlyph/WTMGlyphDetector.m
Expand Up @@ -106,6 +106,10 @@ - (void)addPoint:(CGPoint)point {
[self.points addObject:[NSValue valueWithCGPoint:point]];
}

- (void)removeAllPoints {
[self.points removeAllObjects];
}

- (void)detectGlyph {

// Take the captured points and make a Template
Expand Down Expand Up @@ -133,7 +137,7 @@ - (void)detectGlyph {
float score = 1 / [glyph recognize:inputTemplate];
DebugLog(@"Glyph: %@ Score: %f", glyph.name, score);
result = [NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:glyph.name, [NSNumber numberWithFloat:score], nil]
forKeys:[NSArray arrayWithObjects:@"glyph", @"score", nil]];
forKeys:[NSArray arrayWithObjects:@"name", @"score", nil]];
[results addObject:result];

if (score > highestScore) {
Expand Down

0 comments on commit 311cee6

Please sign in to comment.