6 /* current processing image related */
11 /* current processing image related */
19 int m_id_t; // 0--Ipyr1; 1--Ipyr2;
28 this.m_counter = counter;
29 this.m_rows = this.m_rows_r = rows;
30 this.m_cols = this.m_cols_r = cols;
32 this.m_result = new float[rows * cols];
39 public int getRows() {
43 public int getCols() {
47 public float[] getImage() {
51 public int getRowsR() {
55 public int getColsR() {
59 public float[] getResult() {
63 public boolean addCalcSobelResult(IXL ixl) {
64 int startRow = ixl.getRowsRS();
65 int endRow = ixl.getRowsRE();
69 image = this.m_result;
76 for(i = startRow; i < endRow; i++) {
77 for(j = 0; j < cols; j++) {
78 image[i * cols + j] = r[k * cols + j];
83 return (0 == this.m_counter);
86 public void calcSobel_dX() {
87 int rows_k1, cols_k1, rows_k2, cols_k2;
88 int[] kernel_1, kernel_2;
90 int kernelSize, startCol, endCol, halfKernel, startRow, endRow;
91 int k, i, j, kernelSum_1, kernelSum_2;
92 float[] result, image;
93 int rows = this.m_rows_r;
94 int cols = this.m_cols_r;
96 image = this.m_result;
100 kernel_1 = new int[rows_k1 * cols_k1];
103 kernel_2 = new int[rows_k2 * cols_k2];
118 startCol = 1; //((kernelSize)/2);
119 endCol = cols - 1; //(int)(cols - (kernelSize/2));
120 halfKernel = 1; //(kernelSize-1)/2;
122 startRow = 1; //(kernelSize)/2;
123 endRow = (rows-1); //(rows - (kernelSize)/2);
125 for(i=startRow; i<endRow; i++) {
126 for(j=startCol; j<endCol; j++) {
128 for(k=-halfKernel; k<=halfKernel; k++) {
129 temp += (float)(image[(i+k) * cols + j]
130 * (float)(kernel_1[k+halfKernel]));
132 image[i * cols + j] = (float)(temp/kernelSum_1);
133 image[i * cols + j] = (float)(image[i * cols + j] + 128);
138 public void printImage() {
140 for(int i=0; i<this.m_rows; i++) {
141 for(int j=0; j<this.m_cols; j++) {
142 System.printI((int)(this.m_image[i * this.m_cols + j]*10));
147 public void printResult() {
149 for(int i=0; i<this.m_rows_r; i++) {
150 for(int j=0; j<this.m_cols_r; j++) {
151 System.printI((int)(this.m_result[i * this.m_cols_r + j]*10));