4 /* current processing image related */
15 /* id indicating the piece # */
36 public float[] getResult() {
40 public int getRowsRS() {
41 return this.m_rows_rs;
44 public int getRowsRE() {
45 return this.m_rows_re;
48 public int getColsR() {
52 public int getRows() {
56 public int getCols() {
60 public void calcSobel_dX() {
61 int rows_k1, cols_k1, rows_k2, cols_k2;
62 int[] kernel_1, kernel_2;
64 int kernelSize, startCol, endCol, halfKernel, startRow, endRow;
65 int k, i, j, kernelSum_1, kernelSum_2;
66 float[] result, image;
67 int rows = this.m_rows;
68 int cols = this.m_cols;
72 this.m_rows_rs = this.m_id * this.m_range;
73 this.m_rows_re = (this.m_id + 1) * this.m_range;
75 result=this.m_result=new float[(this.m_rows_re-this.m_rows_rs)*this.m_cols_r];
79 kernel_1 = new int[rows_k1 * cols_k1];
82 kernel_2 = new int[rows_k2 * cols_k2];
97 startCol = 1; //((kernelSize)/2);
98 endCol = cols - 1; //(int)(cols - (kernelSize/2));
99 halfKernel = 1; //(kernelSize-1)/2;
101 if((this.m_rows_re < 1) || (this.m_rows_rs > rows - 1)) {
104 startRow = (1>this.m_rows_rs)?1:(this.m_rows_rs); //(kernelSize)/2;
105 endRow = ((rows-1)<this.m_rows_re)?(rows-1):(this.m_rows_re); //(rows - (kernelSize)/2);
107 int ii = startRow - this.m_rows_rs;
108 for(i=startRow; i<endRow; i++) {
109 for(j=startCol; j<endCol; j++) {
111 for(k=-halfKernel; k<=halfKernel; k++) {
112 temp += (float)(image[i * cols + (j+k)]
113 * (float)(kernel_2[k+halfKernel]));
115 result[ii * cols + j] = (float)(temp/kernelSum_2);
121 public void printResult() {
123 System.printI(11111111);
124 for(int i=0; i<this.m_rows_re-this.m_rows_rs; i++) {
125 for(int j=0; j<this.m_cols_r; j++) {
126 System.printI((int)(this.m_result[i * this.m_cols_r + j]*10));