/* id indicating the piece # */
int m_id;
int m_range;
+ int m_pnum;
/* constructor */
public BlurPiece(int id,
int range,
- int[] data) {
+ int[] data,
+ int pnum) {
this.m_id = id;
this.m_range = range;
this.m_image = data;
this.m_rows = data[0];
this.m_cols = data[1];
+ this.m_pnum = pnum;
}
public int getId() {
if(rows < this.m_rows_re) {
this.m_rows_re = rows;
}
+ if(this.m_id == this.m_pnum - 1) {
+ this.m_rows_re = rows;
+ }
this.m_cols_r = this.m_cols;
image = this.m_result = new float[(this.m_rows_re-this.m_rows_rs)*cols];
int ii = startRow - this.m_rows_rs;
for(i=startRow; i<endRow; i++){
for(j=startCol; j<endCol; j++) {
- temp = 0;
+ temp = 0.0f;
for(k=-halfKernel; k<=halfKernel; k++) {
- temp += (float)((inputs[4 + i * cols + (j+k)]
- * (float)(kernel[k+halfKernel])));
+ temp += (float)(inputs[4 + i * cols + (j+k)]*(kernel[k+halfKernel]));
}
image[ii * cols + j] = (float)(temp/kernelSum);
/* id indicating the piece # */
int m_id;
int m_range;
+ int m_pnum;
/* constructor */
public BlurPieceL(int id,
int range,
- int[] data) {
+ int[] data,
+ int pnum) {
this.m_id = id;
this.m_range = range;
this.m_image = data;
this.m_rows = data[0];
this.m_cols = data[1];
+ this.m_pnum = pnum;
}
public int getId() {
if(rows < this.m_rows_re) {
this.m_rows_re = rows;
}
+ if(this.m_id == this.m_pnum - 1) {
+ this.m_rows_re = rows;
+ }
this.m_cols_r = this.m_cols;
image = this.m_result = new float[(this.m_rows_re-this.m_rows_rs)*cols];
for(j=startCol; j<endCol; j++) {
temp = 0;
for(k=-halfKernel; k<=halfKernel; k++) {
- temp += (float)((inputs[4 + i * cols + (j+k)]
- * (float)(kernel[k+halfKernel])));
+ temp += (float)(inputs[4 + i * cols + (j+k)]*(kernel[k+halfKernel]));
}
image[ii * cols + j] = (float)(temp/kernelSum);
/* id indicating the piece # */
int m_id;
int m_range;
+ int m_pnum;
/* constructor */
public IDX(int nfea,
float[] data,
int rows,
int cols,
- int r) {
+ int r,
+ int pnum) {
this.N_FEA = nfea;
this.m_id = id;
this.m_rows = rows;
this.m_cols = cols;
this.m_r = r;
+ this.m_pnum = pnum;
this.m_rows_rs = this.m_id * this.m_range;
this.m_rows_re = (this.m_id + 1) * this.m_range;
+ if(this.m_id == this.m_pnum - 1) {
+ this.m_rows_re = rows;
+ }
this.m_cols_r = cols;
this.m_ind = new int[(this.m_rows_re - this.m_rows_rs) * this.m_cols_r];
/* id indicating the piece # */
int m_id;
int m_range;
+ int m_pnum;
/* constructor */
public IXL(int id,
int range,
float[] data,
int rows,
- int cols) {
+ int cols,
+ int pnum) {
this.m_id = id;
this.m_range = range;
this.m_image = data;
this.m_rows = rows;
this.m_cols = cols;
+ this.m_pnum = pnum;
}
public int getId() {
this.m_rows_rs = this.m_id * this.m_range;
this.m_rows_re = (this.m_id + 1) * this.m_range;
+ if(this.m_id == this.m_pnum - 1) {
+ this.m_rows_re = rows;
+ }
this.m_cols_r = cols;
result=this.m_result=new float[(this.m_rows_re-this.m_rows_rs)*this.m_cols_r];
for(j=startCol; j<endCol; j++) {
temp = 0;
for(k=-halfKernel; k<=halfKernel; k++) {
- temp += (float)(image[i * cols + (j+k)]
- * (float)(kernel_2[k+halfKernel]));
+ temp += (float)(image[i * cols + (j+k)]*kernel_2[k+halfKernel]);
}
result[ii * cols + j] = (float)(temp/kernelSum_2);
}
/* id indicating the piece # */
int m_id;
int m_range;
+ int m_pnum;
/* constructor */
public IXLR(int id,
int range,
float[] data,
int rows,
- int cols) {
+ int cols,
+ int pnum) {
this.m_id = id;
this.m_range = range;
this.m_image = data;
this.m_rows = rows;
this.m_cols = cols;
+ this.m_pnum = pnum;
}
public int getId() {
this.m_rows_rs = this.m_id * this.m_range;
this.m_rows_re = (this.m_id + 1) * this.m_range;
+ if(this.m_id == this.m_pnum - 1) {
+ this.m_rows_re = rows;
+ }
this.m_cols_r = cols;
result=this.m_result=new float[(this.m_rows_re-this.m_rows_rs)*this.m_cols_r];
/* id indicating the piece # */
int m_id;
int m_range;
+ int m_pnum;
/* constructor */
public IYL(int id,
int range,
float[] image,
int rows,
- int cols) {
+ int cols,
+ int pnum) {
this.m_id = id;
this.m_range = range;
this.m_image = image;
this.m_rows = rows;
this.m_cols = cols;
+ this.m_pnum = pnum;
}
public int getId() {
this.m_rows_rs = this.m_id * this.m_range;
this.m_rows_re = (this.m_id + 1) * this.m_range;
+ if(this.m_id == this.m_pnum - 1) {
+ this.m_rows_re = rows;
+ }
this.m_cols_r = cols;
result=this.m_result=new float[(this.m_rows_re-this.m_rows_rs)*this.m_cols_r];
/* id indicating the piece # */
int m_id;
int m_range;
+ int m_pnum;
/* constructor */
public IYLR(int id,
int range,
float[] image,
int rows,
- int cols) {
+ int cols,
+ int pnum) {
this.m_id = id;
this.m_range = range;
this.m_image = image;
this.m_rows = rows;
this.m_cols = cols;
+ this.m_pnum = pnum;
}
public int getId() {
this.m_rows_rs = this.m_id * this.m_range;
this.m_rows_re = (this.m_id + 1) * this.m_range;
+ if(this.m_id == this.m_pnum - 1) {
+ this.m_rows_re = rows;
+ }
this.m_cols_r = cols;
result=this.m_result=new float[(this.m_rows_re-this.m_rows_rs)*this.m_cols_r];
/* id indicating the piece # */
int m_id;
int m_range;
+ int m_pnum;
/* constructor */
public ImageX(int id,
int range,
float[] data,
int rows,
- int cols) {
+ int cols,
+ int pnum) {
this.m_id = id;
this.m_range = range;
this.m_image = data;
this.m_rows = rows;
this.m_cols = cols;
+ this.m_pnum = pnum;
}
public int getId() {
this.m_rows_rs = this.m_id * this.m_range;
this.m_rows_re = (this.m_id + 1) * this.m_range;
+ if(this.m_id == this.m_pnum - 1) {
+ this.m_rows_re = rows;
+ }
this.m_cols_r = cols;
result=this.m_result=new float[(this.m_rows_re-this.m_rows_rs)*this.m_cols_r];
/* id indicating the piece # */
int m_id;
int m_range;
+ int m_pnum;
/* constructor */
public ImageY(int id,
int range,
float[] image,
int rows,
- int cols) {
+ int cols,
+ int pnum) {
this.m_id = id;
this.m_range = range;
this.m_image = image;
this.m_rows = rows;
this.m_cols = cols;
+ this.m_pnum = pnum;
}
public int getId() {
this.m_rows_rs = this.m_id * this.m_range;
this.m_rows_re = (this.m_id + 1) * this.m_range;
+ if(this.m_id == this.m_pnum - 1) {
+ this.m_rows_re = rows;
+ }
this.m_cols_r = cols;
result=this.m_result=new float[(this.m_rows_re-this.m_rows_rs)*this.m_cols_r];
this.m_count = 0;
this.m_num_bp = 0;
- this.m_num_bpl = 0;
+ this.m_num_bpl = 0;
this.WINSZ = 8;
this.N_FEA = 16; //00;
*/
this.m_3f = new float[3][this.N_FEA];
this.m_rows_3f = this.N_FEA;
- this.m_cols_3f = this.N_FEA;
+ this.m_cols_3f = 1; //this.N_FEA;
this.m_counter_3f = 3;
this.m_num_p = nump;
- this.m_rows = 0;
- this.m_cols = 0;
- this.m_image = null;
- this.m_image_resized = null;
- this.m_rows_r = 0;
- this.m_cols_r = 0;
+ this.m_rows = 0;
+ this.m_cols = 0;
+ this.m_image = null;
+ this.m_image_resized = null;
+ this.m_rows_r = 0;
+ this.m_cols_r = 0;
- this.m_features = null;
- this.m_rows_f = 0;
- this.m_cols_f = 0;
+ this.m_features = null;
+ this.m_rows_f = 0;
+ this.m_cols_f = 0;
}
public int getNumP() {
for(i=startRow; i<endRow; i++) {
for(j=startCol; j<endCol; j++) {
- temp = 0;
+ temp = 0.0f;
for(k=-halfKernel; k<=halfKernel; k++) {
temp += (float)((image[(i+k) * cols + j]
* (float)(kernel[k+halfKernel])));
for(j=0; j<outputCols; j++) {
tempVal = 0;
for(k=-halfKernel; k<=halfKernel; k++) {
- tempVal += (float)(temp[(i+k) * outputCols + j]
- * (float)(kernel[k+halfKernel]));
+ tempVal += (float)(temp[(i+k) * outputCols + j]*kernel[k+halfKernel]);
}
resized[m * outputCols + j] = (float)(tempVal/kernelSum);
}
t1 = (float)0;
if ((C_ROBUST * interestPnts[rows1 * cols1 + 2])
- >= srtdPnts[supId[i] * cols_sp + 2]) {
- t = srtdPnts[supId[i] * cols_sp + 0] - interestPnts[rows1 * cols1 + 0];
- t1 = srtdPnts[supId[i] * cols_sp + 1] - interestPnts[rows1 * cols1 + 1];
+ >= srtdPnts[i * cols_sp + 2]) {
+ t = srtdPnts[i * cols_sp + 0] - interestPnts[rows1 * cols1 + 0];
+ t1 = srtdPnts[i * cols_sp + 1] - interestPnts[rows1 * cols1 + 1];
t = t * t + t1 * t1;
t1 = (float)0;
}
if ((C_ROBUST * interestPnts[rows1 * cols1 + 2])
- < srtdPnts[supId[i] * cols_sp + 2]) {
+ < srtdPnts[i * cols_sp + 2]) {
t1 = (float)1 * (float)MAX_LIMIT;
}
- if (suppressR[supId[i]] > (t + t1)) {
- suppressR[supId[i]] = t + t1;
+ if (suppressR[i] > (t + t1)) {
+ suppressR[i] = t + t1;
}
}
rows_v = 1;
cols_v = nFeatures;
valid = new int[rows_v * cols_v];
+ for(int valid_idx=0;valid_idx<valid.length;valid_idx++){
+ valid[valid_idx]=1;
+ }
for(i=0; i<nFeatures; i++) {
dX = (float)0;