diff options
author | Thomas White <taw@physics.org> | 2010-02-17 15:04:14 +0100 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2010-02-17 15:04:14 +0100 |
commit | c7c73d91c8eb909ecd2e8911ee2dd051d398412b (patch) | |
tree | 5cab7031505bcc95806930e110e45bf1057d94fc /src/index.c | |
parent | ae76664c17533d29555aeef41b7534c78407825f (diff) |
Fix obvious mapping bugs
Diffstat (limited to 'src/index.c')
-rw-r--r-- | src/index.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/index.c b/src/index.c index 4e8460f6..49e21bb7 100644 --- a/src/index.c +++ b/src/index.c @@ -50,11 +50,13 @@ int map_position(struct image *image, double dx, double dy, x = ((double)dx - image->det.panels[p].cx); y = ((double)dy - image->det.panels[p].cy); found = 1; + break; } } if ( !found ) { - ERROR("No mapping found for %f,%f\n", dx, dy); - return 0; + ERROR("No mapping found for %f,%f (map_position)\n", dx, dy); + *rx = 0.0; *ry = 0.0; *rz = 0.0; + return 1; } /* Convert pixels to metres */ @@ -113,13 +115,14 @@ void index_pattern(struct image *image, IndexingMethod indm, int no_match) for ( i=0; i<image_feature_count(image->features); i++ ) { struct imagefeature *f; + int c; f = image_get_feature(image->features, i); if ( f == NULL ) continue; - if ( map_position(image, f->x, f->y, &f->rx, &f->ry, &f->rz) ) { - nc++; - } + c = map_position(image, f->x, f->y, &f->rx, &f->ry, &f->rz); + if ( c != 0 ) nc++; + } if ( nc ) { ERROR("Failed to map %i reflections\n", nc); |