int AbsScarRegionDetector::find_closest_region(int idx, float * score){ region_t * region = this->regions[idx]; int id = -1; for(int i=0; i < this->n_regions; i++){ if(i == idx) continue; //printf("score [%d,%d]:", idx, i); float sc = score_region(region, this->regions[i]); if(id < 0 || sc > *score){ id = i; *score = sc; } } return id; }
void track_frame (IseFramework* ig, unsigned int idx, Frame* f) { TrackerInfo* ti = &ig->panel[idx].tracker_info; const int xmin = 200; const int xmax = 1848; const int ymin = 200; const int ymax = 1336; /* Don't track dark frames. In the future, we'll extrapolate the position using a Kalman filter or something. */ if (frame_is_dark(f)) { return; } score_region (ti, f); /* Truncate output */ if (ti->m_curr_x < xmin) ti->m_curr_x = xmin; if (ti->m_curr_x > xmax) ti->m_curr_x = xmax; if (ti->m_curr_y < ymin) ti->m_curr_y = ymin; if (ti->m_curr_y > ymax) ti->m_curr_y = ymax; }