Skip to content

Commit

Permalink
limit fuzzy fiducials to lost leaf nodes (more accurate angle)
Browse files Browse the repository at this point in the history
  • Loading branch information
mkalten committed May 22, 2017
1 parent 6c43c8e commit 10744ef
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
11 changes: 6 additions & 5 deletions common/FidtrackFinder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ bool FidtrackFinder::init(int w, int h, int sb, int db) {
setBlobSize = false;
setObjectBlob = false;
setFingerBlob = false;

return true;
}

Expand Down Expand Up @@ -753,14 +752,16 @@ void FidtrackFinder::process(unsigned char *src, unsigned char *dest) {
// check for fuzzy ID
else if ((alt_fid!=NULL) && (alt_fid->id==FUZZY_FIDUCIAL_ID) && (alt_closest<existing_object->getRootSize()/1.1f)) {

existing_object->setTrackingState(FIDUCIAL_FUZZY);
// don't update fuzzy position/angle for resting objects
float distance = existing_object->getScreenDistance(alt_fid->x, alt_fid->y, width, height);
if (distance<2) {
alt_fid->x = existing_object->getX(); // don't update fuzzy position for resting objects
alt_fid->x = existing_object->getX();
alt_fid->y = existing_object->getY();
} if (distance<4) alt_fid->angle = existing_object->getAngle(); // don't update fuzzy angle for resting objects
tuioManager->updateTuioObject(existing_object,alt_fid->x,alt_fid->y,alt_fid->angle);
alt_fid->angle = existing_object->getAngle();
}

existing_object->setTrackingState(FIDUCIAL_FUZZY);
tuioManager->updateTuioObject(existing_object,alt_fid->x,alt_fid->y,alt_fid->angle);
drawObject(existing_object->getSymbolID(),existing_object->getX(),existing_object->getY(),existing_object->getTrackingState());

if (send_fiducial_blobs) {
Expand Down
4 changes: 2 additions & 2 deletions ext/libfidtrack/fidtrackX.c
Original file line number Diff line number Diff line change
Expand Up @@ -465,11 +465,11 @@ void propagate_descendent_count_and_max_depth_upwards(
}else{

if( r->descendent_count >= ft->min_target_root_descendent_count
&& r->descendent_count < ft->max_target_root_descendent_count
&& r->descendent_count <= ft->max_target_root_descendent_count
&& r->depth >= ft->min_depth && r->depth <= ft->max_depth ) {
link_region( &ft->root_regions_head, r );
} else if( r->descendent_count >= ft->min_target_root_descendent_range
&& r->descendent_count < ft->max_target_root_descendent_range
&& r->descendent_count <= ft->max_target_root_descendent_count
&& r->depth >= ft->min_depth && r->depth <= ft->max_depth ) {
r->flags |= FUZZY_SYMBOL_FLAG;
link_region( &ft->root_regions_head, r );
Expand Down
5 changes: 3 additions & 2 deletions ext/libfidtrack/segment.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,9 @@ typedef struct Region{
struct Region *previous, *next;
unsigned char colour;
short left, top, right, bottom;
short center_x, center_y;

//short center_x, center_y;
//sort width, height;

struct Span *first_span;
struct Span *last_span;
int area;
Expand Down

0 comments on commit 10744ef

Please sign in to comment.