From: jzhou Date: Mon, 16 Nov 2009 02:29:53 +0000 (+0000) Subject: changes X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=0c5dd7210ed87bbf20fe0072b89771cba6dde322;p=IRC.git changes --- diff --git a/Robust/src/Benchmarks/Scheduling/Tracking/IDX.java b/Robust/src/Benchmarks/Scheduling/Tracking/IDX.java new file mode 100644 index 00000000..f508a21b --- /dev/null +++ b/Robust/src/Benchmarks/Scheduling/Tracking/IDX.java @@ -0,0 +1,130 @@ +public class IDX { + flag toprocess; + flag tomergeIDX; + flag finish; + + /* current processing image related */ + float[] m_image; + int m_rows; + int m_cols; + int m_r; + + /* results related */ + int m_rows_rs; + int m_rows_re; + int m_cols_r; + int[] m_ind; + + /* benchmark constants */ + public int N_FEA; + + /* id indicating the piece # */ + int m_id; + int m_range; + + /* constructor */ + public IDX(int nfea, + int id, + int range, + float[] data, + int rows, + int cols, + int r) { + this.N_FEA = nfea; + + this.m_id = id; + this.m_range = range; + + this.m_image = data; + this.m_rows = rows; + this.m_cols = cols; + this.m_r = r; + + this.m_rows_rs = this.m_id * this.m_range; + this.m_rows_re = (this.m_id + 1) * this.m_range; + this.m_cols_r = cols; + + this.m_ind = new int[(this.m_rows_re - this.m_rows_rs) * this.m_cols_r]; + } + + public int getR() { + return this.m_r; + } + + public int getRows() { + return this.m_rows; + } + + public int getCols() { + return this.m_cols; + } + + public float[] getImage() { + return this.m_image; + } + + public int[] getInd() { + return this.m_ind; + } + + public int getRowsRS() { + return this.m_rows_rs; + } + + public int getRowsRE() { + return this.m_rows_re; + } + + public int getColsR() { + return this.m_cols_r; + } + + public void fSortIndices() { + int i, j, k, startRow, endRow; + int[] ind; + int rows_i, cols_i; + float[] image; + + image = this.m_image; + + rows_i = this.m_rows; + cols_i = this.m_cols; + ind = this.m_ind; + + startRow = this.m_rows_rs; + endRow = this.m_rows_re; + + int ii = 0; + for(k=0; k rows - 1)) { + return; + } + startRow = (1>this.m_rows_rs)?1:(this.m_rows_rs); //(kernelSize)/2; + endRow = ((rows-1) rows - 1)) { + return; + } + startRow = (1>this.m_rows_rs)?1:(this.m_rows_rs); //(kernelSize)/2; + endRow = ((rows-1) localindex) { + k = k1; + } + if(!f_ind[k1]) { + break; + } + } + if(k == nfea) { + System.printI(77777777); + return false; + } else if(k == rindex) { + k = k1; + } + if(f_ind[k] && (m3f[2][k] != image[localindex])) { + System.printI(88888888); + return false; + } + // move all things after k behind + int p = k1; + for(; p > k; p--) { + m3f[2][p] = m3f[2][p-1]; + h_ind[p] = h_ind[p-1]; + m3f[0][p] = m3f[0][p-1]; + m3f[1][p] = m3f[1][p-1]; + f_ind[p] = true; + } + // insert + m3f[2][p] = image[localindex]; + h_ind[p] = localindex; + localindex++; + m3f[0][p] = Math.ceilf((float)(localindex / (float)r)); + m3f[1][p] = (float)localindex + -(m3f[0][p]-1)*(float)r*(float)1.0; + f_ind[p] = true; + } + } + j++; + } + + this.m_num_p--; + + return (0 == this.m_num_p); } public void calcFeatures() { @@ -335,12 +431,12 @@ public class TrackDemo { f1 = this.m_3f[0]; f2 = this.m_3f[1]; f3 = this.m_3f[2]; - rows_f1 = this.m_rows_3f[0]; - rows_f2 = this.m_rows_3f[1]; - rows_f3 = this.m_rows_3f[2]; - cols_f1 = this.m_cols_3f[0]; - cols_f2 = this.m_cols_3f[1]; - cols_f3 = this.m_cols_3f[2]; + rows_f1 = this.m_rows_3f; + rows_f2 = this.m_rows_3f; + rows_f3 = this.m_rows_3f; + cols_f1 = this.m_cols_3f; + cols_f2 = this.m_cols_3f; + cols_f3 = this.m_cols_3f; interestPnts = this.getANMs(f1, rows_f1, @@ -694,8 +790,6 @@ public class TrackDemo { public void startTrackingLoop() { this.m_image = null; this.m_image_resized = null; - this.m_counter_ix = 2; - this.m_counter_iy = 2; } public float[] getInterpolatePatch(float[] src, @@ -918,74 +1012,38 @@ public class TrackDemo { return valid; } - public boolean addIXLM(IXLM ixlm) { - float[][] Ipyrs = this.m_Ipyrs; // Ipyr1, Ipyr2, dxPyr1, dyPyr1, dxPyr2, dyPyr2; - int[] rows, cols; - int i, j, k; - rows = this.m_rows_i; - cols = this.m_cols_i; - - if(0 == ixlm.getIdT()) { -// for Ipyr1 - i = 0; - } else if(1 == ixlm.getIdT()) { -// for Ipyr2 - i = 1; - } - // dx - j = 2 * (i + 1); - Ipyrs[i] = ixlm.getImage(); - rows[i] = ixlm.getRows(); - cols[i] = ixlm.getCols(); - Ipyrs[j] = ixlm.getResult(); - rows[j] = ixlm.getRowsR(); - cols[j] = ixlm.getColsR(); - - this.m_counter_ix--; - - return (0 == this.m_counter_ix); - } - - public boolean addIYLM(IYLM iylm) { - float[][] Ipyrs = this.m_Ipyrs; // Ipyr1, Ipyr2, dxPyr1, dyPyr1, dxPyr2, dyPyr2; - int[] rows, cols; - int i, j, k; - rows = this.m_rows_i; - cols = this.m_cols_i; - - if(0 == iylm.getIdT()) { -// for Ipyr1 - i = 0; - } else if(1 == iylm.getIdT()) { -// for Ipyr2 - i = 1; - } - // dy - j = 2 * (i + 1) + 1; - Ipyrs[i] = iylm.getImage(); - rows[i] = iylm.getRows(); - cols[i] = iylm.getCols(); - Ipyrs[j] = iylm.getResult(); - rows[j] = iylm.getRowsR(); - cols[j] = iylm.getColsR(); - - this.m_counter_iy--; - - return (0 == this.m_counter_iy); - } - - public void calcTrack() { - float[][] Ipyrs; - int[] rows, cols; + public void calcTrack(IXLM ixlm, + IYLM iylm, + IXLMR ixlmr, + IYLMR iylmr) { + float[][] Ipyrs = new float[6][]; + int[] rows = new int[6]; + int[] cols = new int[6]; float[] newpoints, features, np_temp; int rows_n, cols_n, rows_np, cols_np, i, j, k, m, n, numFind; int[] status; int rows_s, cols_s; + + Ipyrs[0] = ixlm.getImage(); + rows[0] = ixlm.getRows(); + cols[0] = ixlm.getCols(); + Ipyrs[2] = ixlm.getResult(); + rows[2] = ixlm.getRowsR(); + cols[2] = ixlm.getColsR(); + Ipyrs[3] = iylm.getResult(); + rows[3] = iylm.getRowsR(); + cols[3] = iylm.getColsR(); - Ipyrs = this.m_Ipyrs; - rows = this.m_rows_i; - cols = this.m_cols_i; - + Ipyrs[1] = ixlmr.getImage(); + rows[1] = ixlmr.getRows(); + cols[1] = ixlmr.getCols(); + Ipyrs[4] = ixlmr.getResult(); + rows[4] = ixlmr.getRowsR(); + cols[4] = ixlmr.getColsR(); + Ipyrs[5] = iylmr.getResult(); + rows[5] = iylmr.getRowsR(); + cols[5] = iylmr.getColsR(); + features = this.m_features; rows_n = 2; cols_n = this.m_cols_f; @@ -1062,6 +1120,22 @@ public class TrackDemo { } } + public void print3f() { + // result validation + System.printI(11111111); + for(int j=0; j